Computer Networks CS 3623 4 Concept of Data






























- Slides: 30
Computer Networks (CS 3623) #4 | Concept of Data Link Layer #1 Fazmah Arif Yulianto | 20102
Intro � Connecting two or more nodes with a suitable medium is only the first step � What’s next? ◦ ◦ ◦ encoding framing error detection reliable delivery access mediation ◦ ◦ point-to-point links Carrier Sense Multiple Access (CSMA) – Ethernet token rings (IEEE 802. 5 and FDDI) Wireless (IEEE 802. 11) � Context –network technologies-
HW Building Block: Nodes � Assume general-purpose (programmable) computers; e. g. , workstations. � Sometimes (for NW nodes) replaced with special-purpose HW performance & cost � Attributes: ◦ Finite memory limited buffer space ◦ Connects to network via a network adaptor ◦ Fast processor, slow memory
HW Building Block: Links medium: used to propagate signals � The binary data is encoded in the signal � Encoding: � Physical ◦ encoding binary data onto a “high” signal and a “low” signal ◦ modulation—varying the frequency, amplitude, or phase of the signal to effect the transmission of information � Half duplex; full duplex nit nit niiit “sms”. . . --. . . nit nit
Install your own links
Leased from the ‘phone’ company
ADSL - Asynchronous digital subscriber line
Wireless � Infrared ◦ Wavelengths: 850– 950 -nanometer; can be used to transmit data at 1 -Mbps rates over distances of about 10 m � Radio ◦ bands at 5. 2 GHz and 17 GHz are allocated to HIPERLAN (High Performance European Radio LAN) ◦ 2. 4 GHz for use with the IEEE 802. 11 (Wireless LANs); supports data rates of up to 54 Mbps ◦ Bluetooth radio interface; in the 2. 45 -GHz frequency band; short distances (on the order of 10 m) with a bandwidth of 1 Mbps
Agenda �Encoding �Framing �Error Detection � Reliable transmission � Access mediation
1. Encoding: bit signal
Non-Return to Zero � Problem #1 - baseline wander � Problem #2 - Unable to recover clock ◦ receiver keeps an average of the signal it has seen so far to distinguish between low and high signals ◦ too many consecutive 1 s or 0 s average changes more difficult to detect a significant change in the signal ◦ clock recovery depends on having lots of transitions in the signal, no matter what data is being sent
Non-Return to Zero Inverted � Make a transition from the current signal to encode a one, and stay at the current signal to encode a zero; � Solves the problem of consecutive ones
Manchester � transmitting the exclusive-OR of the NRZencoded data and the clock � 50% efficient
4 B/5 B � Idea: every 4 -bits of actual data are encoded in a 5 -bit code; ◦ The 5 -bit codes has no more than one leading 0 and no more than two trailing 0 s ◦ never get more than three consecutive 0 s � 5 -bit codes are transmitted using the NRZI ◦ NRZI already solves the problem of consecutive 1 s � 80% efficiency
4 B/5 B: the codes 4 -bit Data 5 -bit Code 0000 11110 0001 01001 0010 10100 0011 10101 0100 01011 0110 01111 4 -bit Data 5 -bit Code 1000 10011 1010 10111 1100 11011 11100 1111 11101
2. Framing � packet-switched networks blocks of data (frames), not bit streams, are exchanged between nodes � Must determine first and last bit of the frame � Typically implemented by network adaptor � Adaptor fetches (deposits) frames out of (into) host memory
Framing protocol � Byte-oriented protocol ◦ Sentinel approach �BISYNC �PPP ◦ Byte counting approach �DDCMP � Bit-oriented protocol � Clock-based framing ◦ HDLC ◦ SONET
BISYNC: Binary Synchronous Communication � ETX character might appear in the data portion ◦ “escaping” the ETX character by preceding it with a DLE (data-link-escape) character ◦ DLE character is also escaped (by preceding it with an extra DLE) in the frame body
PPP: point-to-point protocol � Flag: 01111110 � payload size: negotiated, default: 1500 bytes � Checksum: 2 (default) or 4 bytes � Negotiation by LCP (link control protocol) ◦ LCP PDUs are encapsulated in PPP payload
DDCMP: Digital Data Communication Message Protocol � the COUNT field specifies how many bytes are contained in the frame’s body � Problem: Count field is corrupted catch when CRC fails ◦ The receiver will then wait until it sees the next SYN character
HDLC: High-Level Data Link Control � It views the frame as a collection of bits � Begin & End: 01111110 ◦ also transmitted during link idle maintain clock � Bit Stuffing ◦ Sender: if five consecutive 1 s have been transmitted from the body of the message, insert a 0. ◦ Receiver: five consecutive 1 s arrive, look: �–if next bit is a 0: remove it �–if next bits are 10: end-of-frame marker �–if next bits are 11: error
SONET: Synchronous Optical Network � the lowest-speed SONET: STS-1, 51. 84 Mbps � The first 2 bytes: a special bit pattern � bit stuffing is not used ◦ Special bit patterns shows up once every 810 bytes sync
3. Error Detection � Error handling: ◦ Error detection ◦ Error correction: �Backward: retransmission �Forward: error-correcting codes � Techniques ◦ ◦ ◦ . . . Two-Dimensional Parity Internet Checksum Algorithm Cyclic Redundancy Check. . .
Two-Dimensional Parity � Parity: odd | even � 2 D parity: ◦ a parity bit for each byte ◦ extra parity byte for the entire frame � Catches: ◦ all 1 -, 2 -, and 3 -bit errors ◦ most 4 -bit errors
Internet Checksum � it is not used at the link level � The idea: ◦ add up all the words that are transmitted and then transmit the result of that sum � Internet checksum: ◦ data = sequence of 16 -bit integers. ◦ Add them together using 16 -bit ones complement arithmetic and then take the ones complement of the result
Cyclic Redundacy Check � Add k bits of redundant data to an n-bit message. � n-bit message as an n-1 degree polynomial; ◦ MSG=10011010 M(x) = x 7+ x 4 + x 3 + x 1 and receiver have to agree on a divisor polynomial of degree k, C(x) � Transmit polynomial P(x) that is evenly divisible by C(x). P(x) = MSG + redundant bits � Recipient divides P’(x) by C(x). Remainder will be zero if : � sender ◦ There is no error ◦ Error is exactly divisible by C(x)
CRC – Sender side � Multiply M(x) by xk; that is, add k zeroes at the end of the message. ◦ Call this zero-extended message T(x). � Divide T(x) by C(x) and find the remainder. � Subtract the remainder from T(x)
CRC - example � Message = 10011010 or x 7 + x 4 + x 3 + x 1 � C(x) = x 3 + x 2 + 1 � T(x) = 10011010000 � Divide T(x) by C(x); remainder = 101 � P(x) = T(x) – remainder = 10011010101
Common CRC polynomials
Errors that can be detected by C(x) � All single-bit errors, as long as the xk and x 0 terms have nonzero coefficients. � All double-bit errors, as long as C(x) has a factor with at least three terms. � Any odd number of errors, as long as C(x) contains the factor (x+1). � Any “burst” error for which the length of the burst is less than k bits. ◦ Most burst errors of larger than k bits can also be detected