Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lect-9: Link LayerComputer Networks1 371-1-0291 : An Introduction to Computer Networks Handout #9: Link Layer Additional Reading Text book: Chap. 2.6,2.7,2.8.

Similar presentations


Presentation on theme: "Lect-9: Link LayerComputer Networks1 371-1-0291 : An Introduction to Computer Networks Handout #9: Link Layer Additional Reading Text book: Chap. 2.6,2.7,2.8."— Presentation transcript:

1 Lect-9: Link LayerComputer Networks1 371-1-0291 : An Introduction to Computer Networks Handout #9: Link Layer Additional Reading Text book: Chap. 2.6,2.7,2.8 Homepage http://help.cse.bgu.ac.il/cse/Courses/list.asp

2 Lect-9: Link LayerComputer Networks2 The Link Layer Application Physical Link Network Transport Session Presentation LAN-LINK IP TCP UDP The 7-layer OSI Model The 4-layer Internet Model Telnet FTP SMTP HTTP NNTP TFTP

3 Lect-9: Link LayerComputer Networks3 Examples of MAC Protocols (MAC = “Medium Access Control”) Packet-Switched Radio Network Aloha Carrier Sense Multiple Access/Collision Detection Ethernet (IEEE 802.3) Token Passing Token Ring (IEEE 802.5) Fiber Distributed Data Interface (FDDI) Simple Random Complex Deterministic

4 Lect-9: Link LayerComputer Networks4 Goals of MAC Protocols MAC Protocols arbitrate access to a common shared channel among a population of users 1. Fair among users 2. High efficiency 3. Low delay 4. Fault tolerant

5 Lect-9: Link LayerComputer Networks5 Outline  Random Protocols  Aloha  CSMA/CD  Ethernet (CSMA/CD put into practice)  Token Passing Protocols  Common Features  Flavor #1: Release After Reception (RAR)  Flavor #2: Release After Transmission (RAT)  FDDI (RAT put into practice)

6 Lect-9: Link LayerComputer Networks6 If more than one host transmits at the same time Aloha Protocol Central Node Host 1Host 3Host 2 Basic operation: 1.All hosts transmit on one frequency. 2.Central node repeats whatever it receives on the other frequency. If there is a collision, hosts receive corrupted data, and so wait for a randomly chosen time before retransmitting their packets. Collision at central node! f0f1

7 Lect-9: Link LayerComputer Networks7 Aloha Protocol  Aloha protocol is very simple, and fairly robust against failure of a host.  The protocol is distributed among the hosts.  Under low-load, we can expect the delay to be small.  Under high-load, a lot of time is “wasted” sending packets that collide. Improving performance:  Listen for activity before sending a packet.  Detect collisions quickly and stop transmitting.  After a collision, pick the random waiting time so as to maximize throughput.

8 Lect-9: Link LayerComputer Networks8 Outline  Random Protocols  Aloha  CSMA/CD  Ethernet (CSMA/CD put into practice)  Token Passing Protocols  Common Features  Flavor #1: Release After Reception (RAR)  Flavor #2: Release After Transmission (RAT)  FDDI (RAT put into practice)

9 Lect-9: Link LayerComputer Networks9 CSMA/CD Protocol All hosts transmit & receive on one channel Packets are of variable size. When a host has a packet to transmit: 1. Carrier Sense: Check that the line is quiet before transmitting. 2. Collision Detection: Detect collision as soon as possible. If a collision is detected, stop transmitting; wait a random time, then return to step 1. binary exponential backoff

10 Lect-9: Link LayerComputer Networks10 CSMA/CD Network Size Restriction To ensure that a packet is transmitted without a collision, a host must be able to detect a collision before it finishes transmitting a packet. PROP t=0 t=PROP- t=PROP t=2PROP- A B Events: t=0: Host A starts transmitting a packet. t=PROP--: Just before the first bit reaches Host B, Host B senses the line to be idle and starts to transmit a packet. t=PROP-: A collision takes place near Host B. t=PROP: Host B receives data whilst transmitting, and so detects the collision. t=2PROP-: Host A receives data whilst transmitting, and so detects the collision.

11 Lect-9: Link LayerComputer Networks11 CSMA/CD Network Size Restriction “To ensure that a packet is transmitted without a collision, a host must be able to detect a collision before it finishes transmitting a packet.”

12 Lect-9: Link LayerComputer Networks12 Performance of CSMA/CD Finding the efficiency We’re going to analyze the performance of a CSMA/CD Efficiency, , is simply the fraction of time spent sending useful/successful data. Therefore,  Amount of useful data sent Time taken to send data To be shown

13 Lect-9: Link LayerComputer Networks13 Performance of CSMA/CD 1.Our performance metric will be Efficiency,  This is defined to be the fraction of time spent sending useful/successful data. The more time spent causing and detecting collisions, the less efficient the protocol is. More precisely: 2.To make the analysis simple, we’ll assume that time is slotted and all packets are the same length. In any given time slot, a host will either decide to transmit or not with probability p. (This includes packets transmitted for the first time and retransmissions).

14 Lect-9: Link LayerComputer Networks14 Performance of CSMA/CD 1.First, we will try and find the value of p that maximizes the throughput (in fact, it’s the “goodput”). 2.Then, using the optimal value of p, we’ll find the efficiency.

15 Lect-9: Link LayerComputer Networks15 Performance of CSMA/CD Maximizing goodput N - the number of hosts

16 Lect-9: Link LayerComputer Networks16 Performance of CSMA/CD Finding the overhead Define A to be the expected number of time slots wasted before a packet is transmitted successfully:

17 Lect-9: Link LayerComputer Networks17 Performance of CSMA/CD Finding the efficiency

18 Lect-9: Link LayerComputer Networks18 Performance of CSMA/CD From simulation and more precise models:

19 Lect-9: Link LayerComputer Networks19 Outline  Random Protocols  Aloha  CSMA/CD  Ethernet (CSMA/CD put into practice)  Token Passing Protocols  Common Features  Flavor #1: Release After Reception (RAR)  Flavor #2: Release After Transmission (RAT)  FDDI (RAT put into practice)

20 Lect-9: Link LayerComputer Networks20 The Original Ethernet Thick copper coaxial cable 10Mb/s In practice, minimum packet size = 512 bits. allows for extra time to detect collisions. allows for “repeaters” that can boost signal. Repeaters every 500m

21 Lect-9: Link LayerComputer Networks21 The Original Ethernet Original picture drawn by Bob Metcalfe, inventor of Ethernet (1972 – Xerox PARC)

22 Lect-9: Link LayerComputer Networks22 Ethernet Frame Format Preamble SFD DA SA Type Data Pad CRC 716620-15000-464 1.Preamble: trains clock-recovery circuits 2.Start of Frame Delimiter: indicates start of frame 3.Destination Address: 48-bit globally unique address assigned by manufacturer. 1b: unicast/multicast 1b: local/global address 4.Type: Indicates protocol of encapsulated data (e.g. IP = 0x0800) 5.Pad: Zeroes used to ensure minimum frame length 6.Cyclic Redundancy Check: check sequence to detect bit errors. Bytes:

23 Lect-9: Link LayerComputer Networks23 The 10Mb/s Ethernet Standard IEEE 802.3 Ethernet MAC Protocol 10Base-510Base-210Base-T10Base-F Different physical layer options 10Base-5: Original Ethernet: large thick coaxial cable. 10Base-2: Thin coaxial cable version. 10Base-T: Voice-grade unshielded twisted-pair Category-3 telephone cable. 10Base-F: Two optical fibers in a single cable.

24 Lect-9: Link LayerComputer Networks24 10Base-T “Twisted pair Ethernet”  Designed to run over existing voice-grade “Category-3” twisted pair telephone wire.  Centralized management (“managed hubs”) lead to more reliability.  Created a huge increase in Ethernet usage. 100m max cable length Repeater “Hub” Router

25 Lect-9: Link LayerComputer Networks25 Increasing the data rate 10Mb/s -> 100Mb/s -> 1Gb/s -> 10Gb/s  Problem:  E.g. CSMA/CD at 100Mb/s over 1500m of cable:  To overcome this two techniques used:  Cable length limited to 100m:  Use “Ethernet Switching” to prevent collisions (in an upcoming lecture).

26 Lect-9: Link LayerComputer Networks26 The 100Mb/s Ethernet Standard “Fast Ethernet” Ethernet MAC Protocol 100Base-T4100Base-TX100Base-FX Different physical layer options Up to 100m of cable per segment. 100Base-T4: Uses four pairs of voice grade Category-3 cable. 100Base-TX: Uses two pairs of data grade Category-5 cable. 100Base-FX: Uses two optical fibers.

27 Lect-9: Link LayerComputer Networks27 The 1Gb/s Ethernet Standard “Gigabit Ethernet” Ethernet MAC Protocol 1000Base-TX1000Base-FX 1000Base-TX: Uses four pairs of data grade Category-5 cable. 1000Base-FX: Uses two optical fibers.

28 Lect-9: Link LayerComputer Networks28 Outline  Random Protocols  Aloha  CSMA/CD  Ethernet (CSMA/CD put into practice)  Token Passing Protocols  Common Features  Flavor #1: Release After Reception (RAR)  Flavor #2: Release After Transmission (RAT)  FDDI (RAT put into practice)

29 Lect-9: Link LayerComputer Networks29 Token Passing Common Features  A token rotates around a ring to each node in turn. We will define: PROP = minimum rotation time around ring.  All nodes (computers, routers, etc.) copy all data and tokens, and repeat them along the ring.  When a node wishes to transmit packet(s), it grabs the token as it passes.  It holds the token while it transmits.  When it is done, it releases the token again and sends it on its way.

30 Lect-9: Link LayerComputer Networks30 Token Passing Common Features Data Token/Data l1l1 l3l3 l2l2 l4l4 TRT=Token Rotation Time Listen: Talk:

31 Lect-9: Link LayerComputer Networks31 Flavor #1: Release After Reception (RAR)  Computer captures token, transmits data, waits for data to successfully travel around ring, then releases token again.  Allows computer to detect erroneous frames and retransmit them. Data time TRANSP Token PROP Token arrives at host 1 Token departs from host 1 Token arrives at host 2 l 1 /c l 2 /cl N /cl 1 /c TRANST Data TRANSP Token arrives at host 3 l 3 /c Token l 2 /c TRANST Example time evolution in which host 1 and host 3 have packets to transmit:

32 Lect-9: Link LayerComputer Networks32 Efficiency of RAR Recall: Efficiency, , is the fraction of time spent sending useful data. Define: T i,j to be the time from when the token arrives at host i until it next arrives at host j.

33 Lect-9: Link LayerComputer Networks33 Flavor #2: Release After Transmission (RAT)  Computer captures token, transmits data, then releases token again. Data time TRANSP Token Token arrives at host 1 Token departs from host 1 Token arrives at host 2 l 1 /c TRANST Data TRANSP Token arrives at host 3 Token l 2 /c TRANST Example time evolution in which host 1 and host 3 have packets to transmit: Token

34 Lect-9: Link LayerComputer Networks34 Efficiency of RAT

35 Lect-9: Link LayerComputer Networks35 Comparison of Efficiencies Example: 100 node network PROP = 1000m/c TRANSP = (1000bits)/ (100Mb/s)

36 Lect-9: Link LayerComputer Networks36 Token Rings Techniques: Release After Reception (RAR) Release After Transmissions (RAT) Examples: RAR: IEEE 802.5 Token Rings RAT: Fiber Distributed Data Interface (FDDI)

37 Lect-9: Link LayerComputer Networks37 Outline  Random Protocols  Aloha  CSMA/CD  Ethernet (CSMA/CD put into practice)  Token Passing Protocols  Common Features  Flavor #1: Release After Reception (RAR)  Flavor #2: Release After Transmission (RAT)  FDDI (RAT put into practice)

38 Lect-9: Link LayerComputer Networks38 FDDI: Fiber Distributed Data Interface  Dual counter-rotating rings  100 Mbps on optical fibers  Up to 500 nodes  Total length less than or equal to 200 km MAC PHY PMD FDDI STANDARD

39 Lect-9: Link LayerComputer Networks39 FDDI: PMD  Specifies fiber, optical transmitters, receivers, connectors and optical bypass switches  Optical transmitters are LEDs with wavelength of 1300nm  Optical receivers are PIN diodes  Three types: multi-mode fiber, single-mode fiber, twisted-pair electrical cable.

40 Lect-9: Link LayerComputer Networks40 FDDI: PHY  Specifies the encoding and modulation  Uses 4B/5B encoding  Modulation: non-return to zero with inversion (NRZI)  One transition at least every three bit periods

41 Lect-9: Link LayerComputer Networks41 FDDI: MAC FDDI MAC Protocol Features: Bounds Maximum Medium Access Time Provides guaranteed bandwidth for special traffic Prevents “hogging” Timed Token Rotation Protocol.

42 Lect-9: Link LayerComputer Networks42 FDDI Timed Token Rotation Protocol 1.All hosts agree on a common Target Token Rotation Time (TTRT). They will aim to make the token rotate around the network at least once per TTRT. Hence, they can each expect to see the token once TTRT. 2.Each host on the network maintains a Timed Token Rotation (TRT) timer, that indicates when the token is next expected to arrive. 3.If the token arrives before TRT expires, we say it is “Early”. If the token arrives after TRT expires, we say it is “Late”. 4.A host can only transmit if it receives the token, AND the token is Early.

43 Lect-9: Link LayerComputer Networks43 FDDI Timed Token Rotation Protocol Time 0: Host receives Token and sets TRT = TTRT ( = 8ms in this example) 8ms 0ms Count down Time until next token is expected (TTRT) Time = 5ms: Token arrives & host wants to transmit one or more packets 8ms 3ms 0ms Reset TRT = TTRT When THT reaches 0ms host cannot start new packet Token is Early Host is allowed to transmit up to 3ms (TTRT-TRT) is transferred to a new counter Token Holding Timer (THT) keeps track of the amount of time host can transmit 3ms TRT THT Count down 0ms

44 Lect-9: Link LayerComputer Networks44 FDDI: Timed Token Example Frames Assume: 4 hosts, all have full buffers to send. TTRT = 3ms Host 1Host 2Host 3Host 4 3ms No Tx TRT expired No Tx TRT expired No Tx TRT expired No Tx TRT expired No Tx TRT expired No Tx TRT expired No Tx TRT expired No Tx TRT expired Frames No Tx TRT expired > 3ms

45 Lect-9: Link LayerComputer Networks45 FDDI: Timed Token Example Assume: not all transmit buffers are full. Host 1Host 2Host 3Host 4 Frames No Tx Nothing to Tx No Tx TRT expired No Tx Nothing to Tx No Tx Nothing to Tx 1.0ms 0.5ms 0.8ms 0.7ms 1.0ms 0.5ms 1.5ms 0.5ms < 3ms

46 Lect-9: Link LayerComputer Networks46 FDDI Timed Token Protocol Proof that TRT < TTRT + TRANSP Token rotates once from A back to A P1P1 T AB P 2 T AB T 1 A T 1 B T 2 A T 2 B Claim: IFT 2 A – T 1 A < TTRT + TRANSP THENT 2 B – T 1 B < TTRT + TRANSP B A

47 Lect-9: Link LayerComputer Networks47 Proof: Early Token at A 1.If T 2 A – T 1 A < TTRT Then T 2 A – T 1 A + P 2 - P 1 < TTRT + TRANSP Hence T 2 B – T 1 B = (T 2 A + P 2 + T AB )- (T 1 A + P 1 + T AB ) < TTRT + TRANSP Late Token at A 2. If TTRT < T 2 A – T 1 A < TTRT + TRANSP Then P 2 = 0 Hence T 2 B – T 1 B = T 2 A – T 1 A – P 1 < TTRT + TRANSP

48 Lect-9: Link LayerComputer Networks48 FDDI MAC Protocol - “Synchronous Traffic” So why do we want to guarantee the token rotation time? Answer: to support special traffic (called “synchronous traffic”) that requires a guaranteed access time to the network. Each time it receives the token, station i can send S i synch traffic. S i ’s are picked so that: sum(S i ) < TTRT – TRANSP, which adds an extra TTRT to maximum TRT. Therefore: TRT < 2 x TTRT

49 Lect-9: Link LayerComputer Networks49 FDDI MAC Protocol: Asynch Traffic Efficiency  ~= TTRT - PROP TTRT Example:10km, 100Mbps FDDI ring with 20 nodes Assume:TTRT = 5ms  ~= 5 x 10 -3 – 10 4 / 2.5 x 10 8 5 x 10 -3 = 99.2%


Download ppt "Lect-9: Link LayerComputer Networks1 371-1-0291 : An Introduction to Computer Networks Handout #9: Link Layer Additional Reading Text book: Chap. 2.6,2.7,2.8."

Similar presentations


Ads by Google