Title: CSCI 5273 Computer Networks Stevens, Chapter 2 Link Layer
1CSCI 5273Computer NetworksStevens, Chapter
2Link Layer
- Dirk GrunwaldAssoc. ProfessorDept. of Computer
ScienceUniversity of Colorado, Boulder
2Whats Covered
- Encapsulation of an IP Datagram in different link
layers - Describes link layer for Ethernet 802.3
- Describes link layer for serial protocols
(SLIP/PPP) - Describes link layer for Loopback
- Structure in BSD O/S and implications
- Describes the Maximum Transmission Unit and how
MTUs are set.
3Standards
- Ethernet defined by Digital, Xerox and Intel
- Later, the IEEE published a different set of
standards - http//grouper.ieee.org/groups/802/
- 802 defines a logical link control common to
all 802 nets - 802.3 covers many CSMA/CD networks
- 802.4 covers token bus networks
- 802.5 covers token ring networks
- 802.11 covers wireless ethernet
4Standards
- In the IP world,
- RFC 894 defines IP-in-ethernet
- RFC 1042 defines IP-in-802
- The host requirements RFC says that all hosts
connected to 10-Mbit Ethernet cable should - Be able to send/receive using RFC 894
- Be able to send/receive a mix of RFC 1042 and 894
packets - May be able to send packets using RFC 1042. If
either can be sent, you must default to 894
packets
5Ethernet 802.3 Encapsulation
- Destination MAC or hardware address
- Each NIC has a unique hardware address
- Source MAC or hardware address
- Protocol type to allow sharing the same physical
media with several different protocols - Type fields are defined by RFC 1700, which makes
RFC 1340 obsolete - Some data
- A checksum
6Ethernet Encapsulation (RFC 894)
6
6
2
46-1500 bytes
4
...
DestAddr.
SrcAddr.
Type
CRC
Payload
0800
IP Datagram
46-1500 bytes
0806
ARP request/reply
PAD
28 bytes
18 bytes
8035
RARP request/reply
PAD
7Variations
- Observation
- Ethernet MAC information is fixed and can be
pre-computed - Data is typically fixed size
- Other fields (IP and TCP headers) can vary in
size and also have CRC fields for end-to-end IP
checksums - RFC 893 describes trailer encapsulation
- The IP and TCP headers move to the end of the
frame - Helps in computing IP checksum
- Allows more efficient use of scatter/gather DMA
hardware
8802.3 Encapsulation
- Explicit length - number of bytes up to but not
including the CRC - 802.2 LLC - link layer control common to all 802
networks and needed for e.g. wireless
communication - DSAP - desination service access point (0xaa)
- SSAP - source service access point (0xaa)
- Control field is set to 3
- 802.2 SNAP - sub-network access protocol
- Fixed origin code (0)
- Type field, as in the Ethernet type field
9802.3 Encapsulation
802.2LLC
802.2SNAP
802.3 MAC
DSAP AA
Control
SSAP AA
Payload has same format as Ethernet encapsulation
10SLIP - Serial Line IP
- Specified in RFC 1055
- IP datagram is terminated by the special END
(0xc0) character. Most implementations transmit
END at the start as well. - If a byte in the IP datagram contains END, the 2
byte sequence 0xdb, 0xdc is transmitted (byte
stuffing). - 0xdb is the SLIP escape (ESC) character.
- If a byte in the IP datagram equals the SLIP ESC,
the 2 byte sequence 0xdb, 0xdd is transmitted
11SLIP Encapsulation w/Byte Stuffing
IP Datagram
C0
DB
DB
DC
DB
DD
C0
12Problems with SLIP
- Each endpoint must know the IP address of the
other endpoint. - Theres no TYPE field -- thus, SLIP only supports
a single protocol - Theres no checksum - thus, all retransmissions
are initiated by end-to-end re-transmissions
13CSLIP - Compressed SLIP
- Delivering one byte of data requires
- 20 byte IP header
- 20 byte TCP header
- CSLIP RFC 1144 reduces overhead to 3 or 5 bytes
- Maintains state of up to 16 TCP connections at
each end - shadows some of the fields in each connection,
and only updates components when they change
14CSLIP Compression (stylized)
- SLIP just sends IP packets
- But, we tend to talk to a small number of
connections at any one time... - Remember redundant information for each
connection - Both sender and receiver agree on the meaning of
each connection - Add a message type header. E.g.
- 0/N/data setup compressed IP information for
connection N - 1/N/data Send data to connection N
15CSLIP example (stylized)
Host AMap connection 1 toSRC128.138.240.10D
ST128.138.241.78Version4, TOS0x10,
...Send ltip1gt to connection 1decode ltip2gt
Host BOkMap connection 2
toSRC128.138.241.78DST 128.138.240.10Version
4, TOS0x10ltdecode ip1gtSend ltip2gt to
connection 2
16PPP - Point-to-Point Protocol
- Encapsulate IP datagrams on a serial link
- A Link Control Protocol (LCP) to establish,
configure and test the data-link connection. - This allows connection feature negotiation
- A family of Network Control Protocols specific to
different network layer protocols - IP
- OSI networks (X.25)
- DECnet
- AppleTalk
17PPP Protocol
FLAG
Addr
Cntl
Proto
Payload
CRC
FLAG
- Byte stuffing as in SLIP/CSLIP protocol
- Bytes with values less than 0x20 are also escaped
to avoid problems with flow-control - Most implementations can negotiate to eliminate
ADDR and CNTL fields, reducing overhead to 1 byte.
18MTU
- Most link layers have a limit to the size of an
IP datagram, or Message Transmission Unit (MTU) - If an IP datagram gt MTU, then it is fragmented
(Chap 11.5)
Network MTU (bytes)Hyperchannel 6553516Mb token
ring 179144MB token ring 4464FDDI 4352Ethernet
1500IEEE 802.3 1492X.25 576PPP 296
19Path MTU
- Messages traverse a route or path through a
network. - The smallest MTU along that path is called the
Path MTU. - Not always constant, since the route between two
nodes in the network can vary - Also, routing isnt a bijective relationship, and
thus the A-gtB MTU may differ from the B-gtA MTU - RFC 1191 defines path MTU discovery.
- Well discuss in 11.6 11.7