Presentation is loading. Please wait.

Presentation is loading. Please wait.

NUS.SOC.CS2105 Ooi Wei Tsang Application Transport Network Link Physical you are here.

Similar presentations


Presentation on theme: "NUS.SOC.CS2105 Ooi Wei Tsang Application Transport Network Link Physical you are here."— Presentation transcript:

1 NUS.SOC.CS2105 Ooi Wei Tsang Application Transport Network Link Physical you are here

2 NUS.SOC.CS2105 Ooi Wei Tsang Physical node-to-node bit-by-bit Network host-to-host Link node-to-node frame-by-frame 101101001000100101010

3 NUS.SOC.CS2105 Ooi Wei Tsang

4 NUS.SoC.CS2105 Ooi Wei Tsang Framing Possible Link Layer Services

5 NUS.SoC.CS2105 Ooi Wei Tsang Shared Point-to- Point Possible Link Layer Services

6 NUS.SOC.CS2105 Ooi Wei Tsang

7 NUS.SoC.CS2105 Ooi Wei Tsang Flow Control Possible Link Layer Services

8 NUS.SoC.CS2105 Ooi Wei Tsang Reliable Unreliable Possible Link Layer Services

9 NUS.SoC.CS2105 Ooi Wei Tsang Error Detection & Recovery Possible Link Layer Services

10 Link Layer Services The link layer is responsible for frame-level node-to- node communication. Datagram from network layer is encapsulated into a link-layer frame for transmission over the physical medium. Link layer may provide the following services: (i) access to physical medium -- either shared access or dedicated access via point-to-point link; (ii) reliable or unreliable services, depending on the bit error rate of the medium; (iii) flow control; (iv) error detection; (v) error correction (where receiver not only knows there is error but knows which bit is in error).

11 NUS.SoC.CS2105 Ooi Wei Tsang Link Layer Adapter

12 Link Layer Adapters Most of link layer is implemented in hardware in the form of an adapter. The adapter is a semi-autonomous unit which can decide to discard frames in error without notifying the OS. Due to its implementation in hardware, we can afford to use more sophisticated/powerful error detection and correction technique in the link layer.

13 NUS.SoC.CS2105 Ooi Wei Tsang Ethernet

14 NUS.SoC.CS2105 Ooi Wei Tsang

15 NUS.SoC.CS2105 Ooi Wei Tsang source and destination address

16 NUS.SoC.CS2105 Ooi Wei Tsang MAC Address 90:AF:F4:CA:BA:03

17 NUS.SoC.CS2105 Ooi Wei Tsang type

18 NUS.SoC.CS2105 Ooi Wei Tsang CRC

19 NUS.SoC.CS2105 Ooi Wei Tsang CRC Cyclic Redundancy Check

20 NUS.SOC.CS2105 Ooi Wei Tsang d data bitsr CRC bits

21 NUS.SOC.CS2105 Ooi Wei Tsang d data bitsr CRC bits r+1 bits G = n x

22 NUS.SOC.CS2105 Ooi Wei Tsang d data bitsr CRC bits r+1 bits G = nx

23 NUS.SOC.CS2105 Ooi Wei Tsang

24 NUS.SOC.CS2105 Ooi Wei Tsang d data bitsr CRC bits r+1 bits G = nx D2 r xor R = nG

25 NUS.SoC.CS2105 Ooi Wei Tsang CRC

26 NUS.SoC.CS2105 Ooi Wei Tsang data

27 NUS.SoC.CS2105 Ooi Wei Tsang preamble

28 Ethernet Ethernet is the current dominant wired link layer protocol. The Ethernet carries up to 1500 bytes of data, with 22 bytes header and 4 bytes trailer. The header consists of (a) source and destination MAC (medium access control) addresses (6 bytes each), (b) a protocol type field (2 byte), indicating which upper layer protocol should handle the data, (c) an 8-byte preamble to “synchronize the adapter” and (d) a 4- byte cyclic redundancy code (CRC) for error correction. The data size of an Ethernet frame must be at least 46 bytes.

29 CRC CRC is a error detection technique. To use CRC, both sender and receiver agree on an r+1 bit pattern, called generator, or G. Leftmost bit of G must be 1. Given a d-bit data to be sent, the sender find a r-bit CRC code such that appending the code to the data (giving d+r bit string) is divisible by G. The resulting d+r bits are sent. The receiver, upon receiving the d+r bits, divide by G to see if the remainder is zero. If not, then error has occured.

30 NUS.SoC.CS2105 Ooi Wei Tsang Shared Point-to- Point Different Link Layer Services

31 NUS.SoC.CS2105 Ooi Wei Tsang Multiple Access Protocols

32 NUS.SoC.CS2105 Ooi Wei Tsang TDM, FDM 1. Channel Partitioning

33 NUS.SoC.CS2105 Ooi Wei Tsang 2. Taking Turns

34 NUS.SoC.CS2105 Ooi Wei Tsang Polling

35 NUS.SoC.CS2105 Ooi Wei Tsang Token Passing

36 Medium Access Protocol When more than one nodes share a medium, we need a protocol to coordinate the access to the medium. The channel partitioning approach divides the channel into slots and dedicate each slot to a node. TDM and FDM are two examples of such method. The second approach is to take turns. In polling, one node is designated as master, and, in a round robin manner, poll other nodes to send data. In token passing, a special frame called token is passed around. After a node that receives the token, it can transmit for sometime, before giving up the token to another node.

37 NUS.SoC.CS2105 Ooi Wei Tsang 3.Random Access

38 NUS.SoC.CS2105 Ooi Wei Tsang Slotted ALOHA

39 NUS.SOC.CS2105 Ooi Wei Tsang

40 NUS.SoC.CS2105 Ooi Wei Tsang ALOHA

41 NUS.SOC.CS2105 Ooi Wei Tsang

42 Medium Access Protocol The third approach is random access. A node try to transmit, and if collide with another node, it will wait a random time before retransmitting the frame. In Slotted ALOHA, time is divided into slots of one frame time (time to transmit a frame). A node wait until beginning of slot to transmit. If collide, retransmit in subsequent slot with probability p. Repeat until success. ALOHA is similar to slotted ALOHA, except that there is no slot -- nodes transmit as soon as they have data to send.

43 NUS.SoC.CS2105 Ooi Wei Tsang CSMA

44 NUS.SOC.CS2105 Ooi Wei Tsang

45 Medium Access Protocol Two simple modifications can improve the efficiency of ALOHA/slotted ALOHA. First, listen before transmit. If another node is sending at the moment, don’t send now. Wait random amount of time and listen again. Second, if another node started sending in the middle of transmission, abort sending. These two modifications are called carrier sensing and collision detection. CSMA perform carrier sensing but not collision detection. CSMA/CD has both. Ethernet uses CSMA/CD.

46 NUS.SoC.CS2105 Ooi Wei Tsang CSMA/CD

47 NUS.SOC.CS2105 Ooi Wei Tsang

48 CSMA/CD Protocol Sense the channel for 96 bit time. If the channel is currently idle, transmit now. If channel is busy, wait until the channel is idle, plus 96 bit time, then transmit. While transmitting, if collision is detected, stop transmitting data, transmit a 48 bit jam signal. Let the current round be the n-th collision in a row for this frame. Pick K randomly from {0, 1, … 2 m-1 } (m = min(n,10)) and wait for 512*K bit time, and repeat again (sense the channel for 96 bit time ….) Note: one bit time = time to transmit one bit


Download ppt "NUS.SOC.CS2105 Ooi Wei Tsang Application Transport Network Link Physical you are here."

Similar presentations


Ads by Google