TCP/IP: Link and Network Layers
Tom Kelliher, CS43
Feb. 29, 1996
Ethernet frame encapsulation (RFC 894):
(IEEE 802.2/802.3 differs)
- Destination, source address
- Type:
- 0x0800 IP datagram
- 0x0806 ARP request/reply
- 0x8035 RARP request/reply
- Data
- CRC --- over rest of frame
Serial line IP --- serial line (modems) is the physical layer
IP datagram ``Encapsulation:''
- frame terminated by END ( 0xc0); also started
- Escape sequence for END character occurring in datagram
- Escape sequence for escape character
Deficiencies:
- Each end must know the other's IP address
- No frame type field --- can use only one protocol at a time
- No checksum
Point to point protocol --- also for serial lines and bit-oriented
synchronous links
Corrects SLIP's deficiencies
Features:
- Real IP datagram encapsulation
- Link control protocol to negotiate link options
- Network control protocol family for network protocols (IP, DECnet,
etc.)
PPP frame:
Protocol:
- 0x0021 IP datagram
- 0xc021 link control data
- 0x8021 network control data
- Everything sent to 127.0.0.1 ``looped back''
- Datagrams broadcast or multicast are looped back and sent to NIC
- Anything sent to host's IP address(es) looped back
- ``Weakest'' link
- Path MTU discovery (fragmentation)
- Best effort service (unreliable):
- datagrams dropped
- datagrams duplicated
- datagrams delivered out of order
- Connectionless: datagrams can take independent routes
IP datagram:
- Version
- Header length --- 32 bit words
- TOS --- 4 TOS bits:
- Minimize delay (telnet/rlogin)
- Maximize throughput (FTP data, SMTP data, DNS zone transfer)
- Maximize reliability (SNMP)
- Minimize monetary cost (NNTP)
- Total length --- header and data
- Identification, flags, fragmentation offset
- Time to live --- hop timer, prevent routing loops
- Protocol --- demultiplexing: TCP, UDP, ICMP, IGMP
- Header Checksum --- re-computed by each router
- Options --- loose, tight source routing; record route, timestamp
Forwarding a received packet from one interface to another
Hosts don't route, but have routing tables
A routing table...
Routing algorithm for hosts/routers:
search routing table for match on entire IP address
search routing table for match on network id
search routing table for default route
generate "host unreachable" or "network unreachable"
Borrowing bits from host portion for network portion
Subnet mask ---- 1's show the network portion
Standard subnet masks:
- Class A: 255.0.0.0 ( 0xff000000)
- Class B: 255.255.0.0 ( 0xffff0000)
- Class C: 255.255.255.0 ( 0xffffff00)
Subnet example for 150.0 (Class B):
- Subnet mask of 255.255.255.0
- 254 subnets (must throw 2 away: 255, 0)
- 254 hosts on each subnet
Advantages of subnetting:
- Smaller routing tables elsewhere on the Internet
- Permits local customizations
netstat, ifconfig
Ethernet frames use ethernet addresses
IP datagrams contain IP addresses
Resolution?
Example involving finger, tcpdump, arp
Proxy ARP
I know my ethernet address, what's my IP address?
Internet Control Message Protocol
Message Types:
- Destination unreachable
- network unreachable
- host unreachable
- protocol unreachable
- port unreachable
- destination network unknown
- destination host unknown
- Echo request (reply?)
- Router advertisement/solicitation
- Time exceeded --- TTL == 0
Send UDP datagrams with bogus port numbers (>30,000) to destination,
starting with TTL = 1
ICMP errors returned:
- Time exceeded: found another router on the path
- Port unreachable: found the destination
Loose source routing to obtain return route
Thomas P. Kelliher
Thu Feb 29 09:33:36 EST 1996
Tom Kelliher