ch 5. the link layer and local area networks myungchul kim [email protected]

38
Ch 5. The Link Layer and Local Area Net works Myungchul Kim [email protected]

Upload: george-chapman

Post on 18-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

Ch 5. The Link Layer and Local Area Networks

Myungchul Kim

[email protected]

Page 2: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

2

– Frame– Error detection, retransmission, flow control, random access – Ethernet, IEEE 802.11 wireless LAN (WiFi), Token Ring, PPP, A

TM– Services offered by a link-layer protocol

Framing Link access: Medium Access Control (MAC) protocol Reliable delivery Flow control Error detection Error correction Half-duplex and full-duplex

– The services by the link layer vs the transport layer

Page 3: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

3

Page 4: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

4

– The link layer is implemented in a network adaptor known as a network interface card (NIC)

– LAN-on-motherboard configuration

Page 5: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

5

Error-Detection and –Correction Techniques

Page 6: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

6

Parirty checks

Page 7: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

7

– Forward error correction (FEC)

Checksumming methods– The receiver checks the checksum by taking the 1s complement

of the sum of the received data (including the checksum).– Why checksumming at the Transport layer and CRC at the link l

ayer?

Page 8: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

8

Cyclic Redundancy Check (CRC)

- generator: The sender and receiver must agree on an r+1 bit pattern- D * 2 r XOR R = nG- D * 2 r = nG XOR R- R = remainder D * 2 r / G- The CRC standards can detect burst errors of fewer than r+1 bits.

Page 9: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

9

Page 10: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

10

Multiple access protocols

– Point-to-point link– Broadcast link: medium access problem– Multiple access protocols– Channel partitioning protocols, random access rptocols and takin

g-turns protocols

Page 11: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

11

Ideal Multiple Access Protocol

Broadcast channel of rate R bps

1. when one node wants to transmit, it can send at rate R.

2. when M nodes want to transmit, each can send at average rate R/M

3. fully decentralized:– no special node to coordinate transmissions– no synchronization of clocks, slots

4. simple

Page 12: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

12

Channel partitioning protocols

– Code Division Multiple Access (CDMA)

Page 13: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

13

– ALOHA All frames L bits Time slots of size L/R seconds The nodes are synchronized so that each node knows when the slot

s begin. If two or more frames collide in a slot, then all the nodes detect the c

ollision event before the slot ends. Max efficiency of the protocol 1/e = 0.37

Page 14: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

14

– ALOHA Max efficiency of the protocol 1/2e

Page 15: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

15

– Carrier Sense Multiple Access (CSMA) Listen before speaking: carrier sensing If someone else begins talking at the same time, stop talking: collisio

n detection CSMA, CSMA/CD

Page 16: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

16

Page 17: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

17

Page 18: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

18

Taking-Turns protocols– Polling protocols: a master node– Token-passing protocol: no master node

Local Area Networks (LANs)– Ethernet: IEEE 802.3– Token Ring: IEEE 802.5– Fiber Distribution Data Interface (FDDI)

Page 19: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

19

Link-layer addressing

MAC address– Link-layer address, LAN address, MAC address– 6 bytes long = 2 48 possible MAC addresses

Page 20: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

20

– No two adaptors have the same address– A flat structure

Address Resolution Protocol (ARP)– To send a datagram, the source node must give its adapter not o

nly the IP datagram but also the MAC address for destination node.

– An ARP module in the sending node takes any IP address on the same LAN as input, and returns the corresponding MAC address.

– DNS vs ARP– ARP query and response

Page 21: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

21

Page 22: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

22

– Sending a datagram to a node off the subnet

Page 23: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

23

A creates IP datagram with source A, destination B A uses ARP to get R’s MAC address for 111.111.111.110 A creates link-layer frame with R's MAC address as dest, frame

contains A-to-B IP datagram A’s NIC sends frame R’s NIC receives frame R removes IP datagram from Ethernet frame, sees its destined to B R uses ARP to get B’s MAC address R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222.222.222.220

111.111.111.110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111.111.111.112

111.111.111.111

A74-29-9C-E8-FF-55

222.222.222.221

88-B2-2F-54-1A-0F

B222.222.222.222

49-BD-D2-C7-56-2A

Page 24: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

24

Ethernet

– Success factors First widely deployed Simple and cheap Kept up with speed race

– Hub: whenever a hub receives a bit from one of its interfaces, it sends a copy of the bit to all of its other interfaces.

Page 25: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

25

– Ethernet frame structure Data field (46 to 1,500 bytes): MTU Destination address (6bytes) Source address (6 bytes) Type field (2 bytes): IP and other network layer protocols CRC (4 bytes) Preamble (8 bytes)

– Connectionless service– Unreliable service

Page 26: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

26

CSMA/CD: Ethernet’s Multiple Access Protocol1. An adapter may begin to transmit at any time.

2. An adapter never transmits a frame when it senses that some other adapter is transmitting. (carrier sensing)

3. A transmitting adapter aborts its transmission as soon as it detects that another adapter is also transmitting. (collision detection)

4. Before attempting a retransmission, and adapter waits a random time that is typically samll compared with the time to transmit a frame. (exponential backoff)

Page 27: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

27

– Ethernet efficiency = 1 / (1 + 5 d prop / d trans ) where d prop = max time to propagate between any two adapter

s and d trans = the time to transmit a maximum-size Ethernet fame.

Ethernet Technologies– Repeater– Point-to-point linkes use switches (no collision, no MAC protoco

l) while broadcast channels use hubs

Page 28: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

28

Link-layer switches

– The role of the switch is to receive incoming link-layer frames and forward them onto outgoing links.

– Filtering– Forwarding– Switch table

Page 29: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

29

Page 30: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

30

– Suppose a frame arrives at the switch on interface x, the switch does If there is no entry for the destination address, the switch broadcast

s the frame. There is an entry in the table with interface x, the switch performs t

he filtering by discarding the frame. There is an entry in the table with interface y ≠ x, the switch perfor

ms its forwarding.

– As long as the switch table is complete and accurate, the switch forwards frames towards destination without any broadcasting.

Page 31: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

31

Self-Learning– The switch table is initially empty.– For each incoming frame received on an interface, the switch st

ores in its table …– Aging time– Plug-and-play devices

Page 32: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

32

Properties of link-layer switching– Elimination of collisions– Heterogeneous links– Management

Switches vs routers– Switch: layer 2, router: layer 3– Switch: plug-and-play, a spanning tree, hundreds hosts– Router: hierachical, thousands of hosts

Page 33: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

33

PPP: The Point-to-Point Protocol

– Error detection– No flow control– No sequencing– Single point link

– Information: max length 1,500 bytes

Page 34: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

34

Page 35: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

35

Link Virtualization: A Network as a Link Layer

– ATM, MPLS: packet-switched, virtual-circuit networks

Asynchronous Transfer Mode (ATM) networks

Page 36: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

36

– An ATM inferface will have an IP address and an ATM address.

Page 37: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

37

Mulitprotocol Label Switching (MPLS)

– Like a switched LAN or ATM network, the MPLS-capable routers do without ever touching the IP header of a packet.

– Traffic engineering– Virtual private network

Page 38: Ch 5. The Link Layer and Local Area Networks Myungchul Kim mckim@icu.ac.kr

38