Presentation is loading. Please wait.

Presentation is loading. Please wait.

ECE 4450:427/527 - Computer Networks Spring 2015

Similar presentations


Presentation on theme: "ECE 4450:427/527 - Computer Networks Spring 2015"— Presentation transcript:

1 ECE 4450:427/527 - Computer Networks Spring 2015
Dr. Nghi Tran Department of Electrical & Computer Engineering Lecture 5.1: Link Layer Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

2 Some Discussions Previously, we saw a network consisting of LINKS interconnecting NODES Simplest network: A link connects two nodes Even though it looks trivial, link is a fundamental aspect of network: one of the first fundamental problems we face Next few lectures focus on LINK LAYER Recall: Our approach is bottom up. How about Physical Layer? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

3 Link Layer: Five Common Problems
Basic problem: you can’t just send datagrams over the link! We first consider how to encode bits into the signal at the source and recover bits at the receiving node Once it is possible to transmit bits, we need to figure out how to package these bits into FRAME Assume each node is able to recognize the collections of bits making up a frame, the third problem is to determine if those bits are in error: Error Detection and Correction If frames arriving at destination contain errors, how to recover from such losses: ARQ Final problem related to multiple-access link: how mediate access to a shared link so that all nodes have a chance to transmit: We focus on Ethernet Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

4 Link Layer: Outline Physical Medium and FIVE additional functions/services in Link Layer: How to 1) encoding bits onto medium so that they can be understood by receiving node With packed-switch, need to consider block of data: 2) Framing Transmission of Frames: corrupted errors: 3) Error detection/correction Reliable delivery: 4) Automatic Repeat reQuest (ARQ). A link shared by multiple nodes: Media access control problem Introduction of Carrier Sense Multiple Access (CSMA) network, e.g., Ethernet Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

5 Link Layer Examples of Link Layer Protocols: Ethernet, WiFi, token ring, LTE, 3G etc Where is Link Layer Implemented? In each node Most parts in a Network Adaptor or a Network Interface Card (NIC): Ethernet card, PCMCI card, card Combination of hardware, software, firmware Note: NIC also implements Physical Layer Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

6 Link Layer sending side: receiving side encapsulates datagram in frame
controller controller sending host receiving host datagram frame sending side: encapsulates datagram in frame adds error checking bits, flow control, etc. receiving side looks for errors, flow control, etc extracts datagram, passes to upper layer at receiving side Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

7 What is Communications?
Two nodes connected by a link and the ultimate objective is to send information from one to the other “The fundamental problem of communication is that of reproducing at one point either exactly or approximately a message selected at another point.” (Claude Shannon 1948) Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

8 Communications System
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

9 Physical Medium & Link Capacity
Signals travel through the medium/channel carrying binary bits Maximum bits carried reliably – Link capacity? Shannon theorem: the upper bound to the capacity of a link in terms of bits per second (bps) as a function of signal-to-noise ratio (S/N) of the link measured in decibels (dB): C = W log2(1+S/N) W: Available bandwidth of link (Hz) Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

10 Link Capacity: Example
C = W log2(1+S/N) What is W for telephone line? What is typical S/N Can signal be weaker than noise? How to get higher C? Higher W, higher C? Higher S/N, higher C? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

11 Link Capacity as Function of W
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

12 Link All practical links rely on some sort of electromagnetic radiation propagating through a medium or, in some cases, through free space One way to characterize links, then, is by the medium they use Typically copper wire in some form (as in Digital Subscriber Line (DSL) and coaxial cable), Optical fiber (as in both commercial fiber-to-the home services and many long-distance links in the Internet’s backbone), or Air/free space (for wireless links) Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

13 Link Another important link characteristic is the frequency
Measured in hertz, with which the electromagnetic waves oscillate Distance between the adjacent pair of maxima or minima of a wave measured in meters is called wavelength Speed of light divided by frequency gives the wavelength. Frequency on a copper cable range from 300Hz to 3300Hz; Wavelength for 300Hz wave through copper is speed of light on a copper / frequency 2/3 x 3 x 108 /300 = 667 x 103 meters. Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

14 Link Electromagnetic spectrum Dr. Nghi Tran (ECE-University of Akron)

15 Links Common services available to connect your home
Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

16 1) Encoding Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

17 Encoding Now we start with the first service: Encoding – How to convert binary bits to signal Not focus on the entire modulation. Instead, we assume the simplest situation: working with two discrete signals: high and low In practice, it corresponds to two different voltages or two different power levels What is an obvious way to convert? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

18 Encoding NRZ (Non-Return to Zero) encoding of a bit stream:
Signals travel between signaling components; bits flow between adaptors NRZ (Non-Return to Zero) encoding of a bit stream: Low signal represents a 0, high signal represents a 1 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

19 NRZ: Problems Problem: Long periods of silence (0s) or high signals (1s) are possible Baseline wander Clock recovery Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

20 NRZ Problem: Baseline Wander
The receiver keeps an average of the signals it has seen so far Uses the average to distinguish between low and high signal When a signal is significantly low than the average, it is 0, else it is 1 Too many consecutive 0’s and 1’s cause this average to change, making it difficult to detect Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

21 NRZ Problem: Clock Recovery
Frequent transition from high to low or vice versa are necessary to enable clock recovery Both the sending and decoding process is driven by a clock Every clock cycle, the sender transmits a bit and the receiver recovers a bit The sender and receiver have to be precisely synchronized Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

22 Other Coding Scheme: NRZI
Non Return to Zero Inverted Sender makes a transition from the current signal to encode 1 and stay at the current signal to encode 0: transition at a clock boundary Solves for consecutive 1’s: Used in USB with bit stuffing Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

23 Other Coding Scheme: Manchester
Merging the clock with signal by transmitting Ex-OR of the NRZ encoded data and the clock In Manchester encoding (used widely in 802.3) 0: low high transition 1: high low transition Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

24 Issues with Manchester
Doubles the rate at which the signal transitions are made on the link Which means the receiver has half of the time to detect each pulse of the signal The rate at which the signal changes is called the link’s baud rate In Manchester the bit rate is half the baud rate Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

25 4B/5B Encoding Encode 4-bit symbols into 5-bit codes
24 symbols must be mapped to 24 codewords out of the possible 25 Each codeword has no more than one starting zero, and no more than two trailing zeros Already solve consecutive 0s problem? Then use NRZI to solve the consecutive 1s problem 80% efficiency (1 bit is overhead) Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

26 4B/5B Encoding 16 left 11111 – when the line is idle
4-bit data symbol 5-bit code 0000 11110 1000 10010 0001 01001 1001 10011 0010 10100 1010 10110 0011 10101 1011 10111 0100 01010 1100 11010 0101 01011 1101 11011 0110 01110 1110 11100 0111 01111 1111 11101 16 left 11111 – when the line is idle 00000 – when the line is dead – to mean halt 13 left : 7 invalid, 6 for various control signals Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

27 4B/5B Encoding 4-bit data symbol 5-bit code 0000 11110 1000 10010 0001 01001 1001 10011 0010 10100 1010 10110 0011 10101 1011 10111 0100 01010 1100 11010 0101 01011 1101 11011 0110 01110 1110 11100 0111 01111 1111 11101 4B/5B: popularized by Fiber Distributed Data Interface (FDDI); also adopted by 802.3, Multichannel Audio Digital Interface Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

28 Other Schemes RZ, RZ-L Bi – Phase, Bi-Phase-L
Miller Code, Miller L etc. Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

29 Example Show 4B/5B encoding and the resulting NRZI signal for the following bit sequences Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

30 2) Framing Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

31 Why Framing? We are focusing on packet-switched networks, which means that blocks of data (called frames at this level), not bit streams, are exchanged between nodes. It is the network adaptor that enables the nodes to exchange frames. Bits flow between adaptors, frames between hosts Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

32 Why Framing? When node A wishes to transmit a frame to node B, it tells its adaptor to transmit a frame from the node’s memory. This results in a sequence of bits being sent over the link. The adaptor on node B then collects together the sequence of bits arriving on the link and deposits the corresponding frame in B’s memory. Recognizing exactly what set of bits constitute a frame—that is, determining where the frame begins and ends—is the central challenge faced by the adaptor Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

33 Framing Byte-Oriented Protocols
To view each frame as a collection of bytes (characters) rather than bits BISYNC (Binary Synchronous Communication) Protocol – Developed by IBM (around 60s) DDCMP (Digital Data Communication Protocol) – Used in DECnet (Digital Equipment Corporation) Widely used PPP (Point-to-Point Protocol) over Internet Bit-Oriented Protocols HDLC (High-Level Data Link Control) Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

34 Frame/Packet Format Frame/packet: Sequence of labeled fields
Above each field: A number indicating the length of that field in bits Frame/packet: transmition beginning with the leftmost field Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

35 BISYNC BISYNC: Binary synchronous communication
Frame is a collection of bytes Need to indicate the beginning and end of a frame Sentinel characters are used SYN: Synchronization character SOH: Start of header STX, ETX: Start of text, End of text CRC: Cyclic redundancy check Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

36 Problem with BISYNC ETX may occur in the payload
Precede it with a DLE (data-link-escape) character Problem propagates, precede DLE with another DLE (extra overhead). Cost is overhead This approach is called character stuffing: extra characters are inserted in data portion Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

37 DDCMP: Byte-Counting Framing
Include the # of bytes in the frame as a field in the header Digital Data Communications Protocol (DDCMP) Count: Specifies # of bytes in the body What happen if Count corrupted? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

38 PPP Framing Recent PPP which is commonly run over Internet links uses sentinel approach Special start of text character denoted as Flag Address, control : default numbers Protocol for demux : IP / IPX Payload : negotiated (1500 bytes) Checksum : for error detection 2-4 bytes Overhead: 8/1508 =0.5% Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

39 HDLC –Bit-oriented Framing
Bit-oriented Protocol HDLC : High Level Data Link Control Beginning and Ending Sequences HDLC Frame Format Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

40 HDLC –Bit-oriented Framing
HDLC Protocol On the sending side, any time five consecutive 1’s have been transmitted from the body of the message (i.e. excluding when the sender is trying to send the distinguished sequence) The sender inserts 0 before transmitting the next bit: Bit stuffing Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

41 HDLC –Bit-oriented Framing
HDLC Protocol On the receiving side 5 consecutive 1’s Next bit 0 : Stuffed, so discard it 1 : Either End of the frame marker Or Error has been introduced in the bitstream Look at the next bit If 0 ( )  End of the frame marker If 1 ( )  Error, discard the whole frame The receiver needs to wait for next before it can start receiving again Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

42 Example of Bit-stuffing
Sender Receiver Length of frame Variable, depends on the data We can calculate and optimize the overhead of bit stuffing x x x x Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

43 Increase frame length as much as possible
Frame Size Example Let each frame contain V overhead bits Let a message of M bits be broken into frames of size Kmax # of packets : The total # of bits for all frames: If Kmax ↓, # of frames ↑, and overhead also ↑ If # of frames ↑, then each frame must be processed then more processing delay at each host Increase frame length as much as possible Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

44 Example Frame Size Why just make Kmax = M?
Pipelining delay: frame must be received before forwarding Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

45 Example Framing What we have discussed so far
Sentinel framing uses special “sentinel” characters (STX, ETX) to indicate the start and end of each frame. Length-based framing specifies the length of the frame in the beginning of the header, so the receiver knows exactly how much data to read Frames usually not same size Clock-based framing (SONET): all frames are the same size - Sender and receiver must have synchronized clocks. All frames fit into a specific time interval. Refer to textbook. Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527


Download ppt "ECE 4450:427/527 - Computer Networks Spring 2015"

Similar presentations


Ads by Google