CSCE 313 Lecture 20

From Notes
Jump to navigation Jump to search

« previous | Thursday, April 5, 2012 | next »


Applications

Standard Applications are well-documented and adopted as official TCP/IP suite:

  • email
  • telnet
  • ftp
  • ...

Sockets are file descriptors: open, close, read, and write.

HTTP

telnet www.tamu.edu 80
GET /


SMTP

  1. Mail User Agent (MUA) is ready to send message
  2. MUA connects to SMTP server
  3. MTA sends message to recipient
telnet servername 25
HELO <your domain name>
MAIL FROM: <your email address>
RCPT TO: <recipient address>
DATA
<type email here>
.
QUIT

Transport Layer

  • TCP - reliable
  • UDP - unreliable

Packets

Information is added incrementally at each layer

Application Layer
data (44 to 1460 bytes)
Transport Layer
TCP/UDP header (20 bytes)
data
Network Layer
IP header (20 bytes)
TCP/UDP header
data
Data Link Layer
frame header (22 bytes)
IP header
TCP/UDP header
data
frame trailer (4 bytes)

Over ethernet data link layer, each computer has a unique 48-bit MAC address. Ethernet Packet structure over two computers on the same network:

  • 8 byte preamble
  • 6 byte destination MAC address
  • 6 byte source MAC address
  • 2 byte type
  • 64-1500 bytes data
  • 4 byte CRC

Address Resolution Protocol (ARP)

Maps 32-bit IP addresses to 48-bit MAC address. Destination responds with "here I am" (unreliable since anyone can respond). ARP results are cached.

Use arp command to view the ARP cache for that machine

Internet Protocol (IP)

Connectionless datagram delivery service. Routes data thorugh intermediate networks and computers

Wireshark can capture network packets. This is the best way to learn IP. tcpdump is an equivalent Linux tool.

Header contains protocol, source and destination IP addresses, TTL, etc.

Packets need to be routed (Router). Each route is a "hop". Use traceroute Linux command to record the hops between client and server.