12
Dept. of EEE CS 65 Computer Networks Prepared by Dr.S.Muralidharan 1 Direct Link Networks A computer network is designed to send/receive information from one point to another. We must transform data into signal to send them from one place to another. This requires data needs to be converted to either a digital signal or analog signal for transmission. Digital-to-Digital or Encoding Digital Data : Digital Data stored in a computer has to be carried from one place to other (inside or outside the computer). Analog-to-Digital or Digitizing an analog signal: Converts analog signal to digital Digital-to-Analog or Modulating a digital signal: Requires to transmit digital signal through a medium designed for an analog signal Analog-to-Analog or Modulating an analog signal : no conversion (voice, telephone) simply high frequency signals are carrying our voice. 49 50 Modulation: Encoding: DIGITAL-TO-DIGITAL CONVERSION We focus only computer communication where digital data is transmitted in the network digitally. A process converting binary data, a sequence of bits, to a digital signal This involves three techniques Line coding Block coding Scrambling Line coding is always needed; block coding and scrambling may or may not be needed.

LECTURE 4-Direct Link Networks PART II

Embed Size (px)

Citation preview

Page 1: LECTURE 4-Direct Link Networks PART II

Dept. of EEE CS 65 Computer Networks

Prepared by Dr.S.Muralidharan 1

Direct Link Networks

• A computer network is designed to send/receive information from one point to another.

• We must transform data into signal to send them from one place to another.

• This requires data needs to be converted to either a digital signal or analog signal for transmission.

• Digital-to-Digital or Encoding Digital Data : • Digital Data stored in a computer has to be carried from one place to other (inside or

outside the computer).

• Analog-to-Digital or Digitizing an analog signal:• Converts analog signal to digital

• Digital-to-Analog or Modulating a digital signal:• Requires to transmit digital signal through a medium designed for an analog signal

• Analog-to-Analog or Modulating an analog signal :• no conversion (voice, telephone) simply high frequency signals are carrying our voice.

49

50

Modulation:

Encoding:

DIGITAL-TO-DIGITAL CONVERSION• We focus only computer communication where digital data is

transmitted in the network digitally.• A process converting binary data, a sequence of bits, to a

digital signal• This involves three techniques

• Line coding• Block coding• Scrambling

• Line coding is always needed; block coding and scrambling may or may not be needed.

Page 2: LECTURE 4-Direct Link Networks PART II

Dept. of EEE CS 65 Computer Networks

Prepared by Dr.S.Muralidharan 2

LINE CODING• is the process of converting digital data to digital signals• Converts sequence of digital bits to digital signal

• Line Coding Schemes• Unipolar

• Simple and primitive• One voltage level• Two problems: DC component & Lack of synchronization

• Polar• Two signal levels: positive & negative• Eliminate DC component

• Biploar• Three signal levels: positive, zero, and negative

digital Digital-to-digital conversion

Unipolar

Polar

BiPolar

UNIPOLAR SCHEME• 1s are encoded as positive value and 0s are encoded as zero

value• suffered from two problems : DC component &

synchornization

Page 3: LECTURE 4-Direct Link Networks PART II

Dept. of EEE CS 65 Computer Networks

Prepared by Dr.S.Muralidharan 3

DC Components (undesirable)• Average amplitude is non-zero value• This creates Direct Current (DC) component • Cannot passing through a transformer• Unnecessary energy on the line

Self-Synchronization (desirable)• For correctly interpret signal• Sending 10110001; receiving 110111000011

• A Self-synchronizing digital signal includes timing information in the data being transmitted. This signal will reset the receiver’s clock if it is out of synchronization.

* NRZ: Non Return to Zero#RZ : Return to Zero

Polar

NRZ*NRZ-L

NRZ-I

RZ#

Biphase

Manchester

Differential Manchester

• NRZ: Non Return to Zero• Classified into two :

• NRZ-L(Non-return zero-Level)• Positive voltage

means 0; Negative voltage means 1.

• Sync. Problem if long string of 0s or 1s is encountered

• NRZ-I(Non-return zero-Invert)• the signal is inverted if

a 1 is encountered• A long string of 0s still

cause sync. problemIn NRZ-L the level of the voltage determines the value of the bit.

In NRZ-I the inversion or the lack of inversion determines the value of the bit.

Page 4: LECTURE 4-Direct Link Networks PART II

Dept. of EEE CS 65 Computer Networks

Prepared by Dr.S.Muralidharan 4

• RZ: Return to Zero• Uses three values:

positive, zero, negative• Ensure Sync: a signal

change for each bit• Main disadvantage: uses

two signal changes to encode one bit

• Biphase :• Signal changes at the middle of the bit interval but does not return to

zero. Instead, it continues to the opposite pole.• Mid-interval transition allow synchronization.• Classified into

• Manchester• Differential Manchester

• Manchester Encoding– Uses two level signal values: positive, negative– Sync: Inversion at the middle of each bit– Zero: High -> Low; One: Low -> High

• Differential Manchester Encoding• Uses two level signal values: positive, negative• Sync: Inversion at the middle of each bit• Zero: A transition; One: No transition

Page 5: LECTURE 4-Direct Link Networks PART II

Dept. of EEE CS 65 Computer Networks

Prepared by Dr.S.Muralidharan 5

Comparison of various Polar techniques

64

RZ BiPolar

Alternate Mask Inversion

(AMI)

Bipolar 8-Zero Substitution

(B8ZS)

High Density Bipolar 3 (HDB3)

• Biploar Alternate Mark Inversion (AMI) Encoding• Uses three level signal values: positive, zero, negative• 0: Zero level; 1: Alternating positive and negative voltages• DC component is zero• Long sequence of 1s synchronized but not 0s• To synchronizing sequential 0s,

• Bipolar 8-zero substitution(B8ZS) : suggested in North America• High Density bipolar 3 (HDB3) : used in Europe and Japan

Bipolar 8-Zero Substitution(B8ZS)• Whenever 8 or more zeros are encountered in the data

stream, an artificial signal change called “violation”• Encoding Rules

• If 8 zeros occur and the last voltage pulse preceding was positive �encode as 000+-0-+

• If 8 zeros occur and the last voltage pulse preceding was negative �encode as 000-+0+-

• Solve the problem of bipolar AMI code where sequence of zero was problem.

• Example of scrambling technique

Page 6: LECTURE 4-Direct Link Networks PART II

Dept. of EEE CS 65 Computer Networks

Prepared by Dr.S.Muralidharan 6

Scrambling• Use special pattern to replace sequences that would produce

constant voltage• Use scrambling to replace sequences that would produce

constant voltage• Filling sequence

• Must produce enough transitions to sync• Must be recognized by receiver and replace with original• Same length as original

• No dc component• No long sequences of zero level line signal• No reduction in data rate• Error detection capability

Two cases of B8ZS scrambling technique

Amplitude

Time

0 0 0 0 0 0 0 01 0 1

Violation Violation

10000000001 ���� +000+-0-+01 in general 00000000����000V(-V)0(-V)V

If 8 zeros occur and the last voltage pulse preceding was negative �encode as 000-+0+- where V = -ve and B= +ve

High Density Bipolar 3 (HDB3)• Followed in Europe & Japan to solve sync. Problem• Goal like B8ZS to improve Sync of AMI• Just like AMI except 4 0’s are replaced by code• As in B8ZS, the pattern of violations in HDB3 is baed on

the polarity of the previous 1 bit.• But unlike B8ZS, HDB3 also looks at the number of 1s that

have occurred in the bit stream since the last substitution.• Replaces every four consecutive 0s based on

• Number of pulses since last substitution• Polarity of last logical 1

Page 7: LECTURE 4-Direct Link Networks PART II

Dept. of EEE CS 65 Computer Networks

Prepared by Dr.S.Muralidharan 7

Last 1 polarity# of 1s + -

Odd 0000�000+ 0000�000-

Even 0000�-00- 0000�+00+

• For 0000 use 000V or B00V• Where B and V are + or –• And V is AMI violation, B is Balance Bit

• Use 000V if EVEN number of + and – pulses so far• Use B00V if ODD, and B is opposite last pulse

Example:• Number of 1s since last substitution is even, last 1 Positive

(before this string)• Encode 100000000001

Amplitude

Time

0 0 0 0 0 0 0 01 0 0 1

Different situations in HDB3 scrambling technique

SUMMARY

Page 8: LECTURE 4-Direct Link Networks PART II

Dept. of EEE CS 65 Computer Networks

Prepared by Dr.S.Muralidharan 8

Data Link Protocol • is a set of specifications used to implementation the data link layer

76

ASYNCHRONOUS PROTOCOL :ASYNCHRONOUS PROTOCOL :• Treat each character in a bit stream independently• Used primarily in modems, • Featured with start and stop bits and variable length gaps between characters• Not complex and are inexpensive to implement.• A data unit is transmitted with no timing coordination between sender and

receiver.• A receiver does not need to know exactly when a data unit is sent; it only needs to

recognize the beginning and the end of the unit. This is done by using extra bits (start and stop bits) to frame the data unit

77

ASYNCHRONOUS ASYNCHRONOUS

SYNCHRONOUS PROTOCOL :SYNCHRONOUS PROTOCOL :• In synchronous transmission

• data is sent in a large block called a frame• Synchronous transmission is used on both

• point-to-point • multipoint circuits

• In multipoint circuits, addressing information needs to be included in the frame.

• Synchronous packets sometimes begin and end with a series of synchronization (SYN) characters that are used to help the receiver recognize incoming data.

• Synchronization refers to the fact the receiver must know when the data begins and when it ends and also the receiver should be able to distinguish between each bit in the frame of data.

78

SYNCHRONOUS SYNCHRONOUS

• Synchronous transmission protocols can be: • bit-oriented:

• Bit-oriented protocol is a communications protocol that sees the transmitted data as an opaque stream of bits with no semantics, or meaning. In simple terms, it interpret a transmission frame as a succession of individual bits.

• Bit oriented protocol can transfer data frames regardless of frame contents. It can also be stated as "bit stuffing" .This technique allows the data frames to contain an arbitrary number of bits and allows character codes with arbitrary number of bits per character.

• May work like this : each frame begins and ends with a special bit pattern 01111110, called a flag byte. whenever the sender's data link layer encounters 5 consecutive ones in the data, it automatically stuffs 0 into the outgoing stream.

• Control information in a bit-oriented protocol can be one or multiple bits depending on the information embodied in the pattern

79

Page 9: LECTURE 4-Direct Link Networks PART II

Dept. of EEE CS 65 Computer Networks

Prepared by Dr.S.Muralidharan 9

• character-oriented:• Also known as byte-oriented protocols• Byte-oriented framing protocol is similar to bit-oriented

protocol except that instead of viewing the frame as a collection of bits, byte-oriented framing views the frame as a collection of bytes.

• In simple way Interpret a transmission frame as a succession of characters• are not as efficient as bit-oriented protocols and therefore now seldom used

• Popular protocol : BSC(Binary synchronous communication)

80

Framing• The main tasks of the data link layer are:

• Transfer data from the network layer of one machine to the network layer of another machine

• Convert the raw bit stream delivered by the physical layer into groups of bits (“frames”)

• It is the network adaptor that enables the nodes to exchange frames. • 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.

81Frames

BitsAdaptor Adaptor Node BNode A

• Upper-layer protocols also divide data into distinct “packets” of information, but the terminology used to define packets at each layer is different:

82

• Message The actual application data, command, or instruction encapsulated within a TCP segment assuming TCP is used.• Segment The packet of information exchanged between two peers that contains TCP information. TCP exchanges segments.• Datagram The packet of information exchanged between two peers containing network layer protocol information. IP exchanges datagrams.• Frame The packet of information at the data link layer. Frames encapsulate datagrams.

• Advantages of Framing• Synchronization recovery• Multiplexing of link• Efficient error detection

• How can one determine the beginning/end of a frame?• Solutions:

• Character-based framing (use special control characters)• BInary SYNchronous Communication (BISYNC)

• Bit-oriented framing with flags• Sentinel-based

• Length counts• Digital Data Communication Message Protocol

• Clock based• SONET: Synchronous Optical Network

83

Page 10: LECTURE 4-Direct Link Networks PART II

Dept. of EEE CS 65 Computer Networks

Prepared by Dr.S.Muralidharan 10

Various Framing Approaches…BISYNC: BISYNC: BInaryBInary SYNchronousSYNchronous CommunicationCommunication

• SYN : These characters alert the receiver to the arrival of a new frame and provide a bit pattern used by the receiving device to synchronize.

• SOH: Start of Header• STX : This signals the receiver that the control information is ending and

the next byte will be data.• ETX : This indicates the end of data• BCC : Block Check Count(BCC) are included for error detection. It

could be either LRC or CRC.

84

SYN SYN SOH Header Body ETX BCC SYNSTX

85

Various Framing Approaches…• Sentinel-based

• Delimiter for frame is with special pattern: 01111110• e.g., HDLC, SDLC, PPP, IEEE 802.4 (Token Bus)

• problem: if the above special pattern (ie.01111110 )appears in the payload, it will be misinterpreted as delimiter.

• solution: bit stuffing• Bit stuffing used to avoid confusion with data containing 01111110

• 0 inserted after every sequence of five 1s• If receiver detects five 1s it checks next bit• If 0, it is deleted• If 1 and seventh bit is 0, accept as flag• If sixth and seventh bits 1, sender is indicating abort

Header Body8 16 16 8

CRCBeginningsequence

Endingsequence

Example for bit stuffing :Example for bit stuffing :A frame before bit stuffing:01111110 01111100 101101111 110010

After011111010 011111000 101101111 1010010

@ receiver end@ receiver end• Receiver reads incoming bits and counts 1’s. • When number of consecutive 1s afterafter a zero is 5, it checks the next bit (7th bit).• If 7th bit = zero � receiver recognizes it as a stuffed bit, discard it and resets the counter.• If the 7th bit = 1 � then the receiver checks the 8th bit; If the 8th bit = 0, the sequence is

recognized as a flag.

01111010 011111000 101101111 1010010

• Disadvantage: potentially increases the length by 20%

86

Example with possible errors

87

Page 11: LECTURE 4-Direct Link Networks PART II

Dept. of EEE CS 65 Computer Networks

Prepared by Dr.S.Muralidharan 11

88

Various Framing Approaches…• Counter-based

• include payload length in header• e.g., DDCMP(Digital Data Communication Message Protocol)

• problem: count field corrupted• solution: catch when CRC fails

• One danger with this approach is that a transmission error could corrupt the count field, in which case the end of the frame would not be correctly detected. Should this happen, the receiver will accumulate as many bytes as the bad COUNT field indicates and then use the error detection field to determine that the frame is bad. This is sometimes called a framing error. The receiver will then wait until it sees the next SYN character to start collecting the bytes that make up the next frame.

8 148

SYN SYN Class Length

8 42

Header

16

Body CRC

89

Various Framing Approaches…• Clock-based

• Continuous stream of fixed-length frames• each frame is 125µs long (all STS formats)

• Clocks must remain synchronized• e.g., SONET: Synchronous Optical Network

• Synchronous Optical Network Standard developed for transmission over fiber.

• SONET frame has special information that tells receiver where frame starts and ends -- no bit stuffing.

• No Bit stuffing is used. Hence the frame length doesnot depend on the bits being sent.

SONET or STS-1 Frames• First three bytes overhead• Total 810 bytes.• 2 byte pattern at beginning -- receiver has to see this every

810 bytes -- if it does it concludes that it is in sync.

90

Overhead Payload

90 columns

9 rows

• Time is the same but now, a different amount of data is transmitted.• In each STS-3 frame we have 3x810 = 2430 bytes.• Interleave bytes --1st byte of first STS-1, 1st byte of 2nd STS-1 and so on.

• Ensures that bytes from each STS-1 are evenly paced and arrive at a smooth 51 Mbps rate at receiver.

• Bottomline: STS-3 channel could contain multiple low-data rate STS-1 channel

91

STS-1 STS-1 STS-1

STS-3cHdr

Page 12: LECTURE 4-Direct Link Networks PART II

Dept. of EEE CS 65 Computer Networks

Prepared by Dr.S.Muralidharan 12

• Payloads linked together instead of interleaving.• Concatenation instead of multiplexing.

• Cannot be multiplexed from different streams.• Called STS-Nc (As an example STS-3c).

• One of the fields in header used to denote concatenation.

• Read rest of stuff on SONET from book.

92

• Bit rate is bits per second• Baud rate is “symbols” per second• If each symbol contains 4 bits then data rate is 4 times the

baud rate

93