Presentation is loading. Please wait.

Presentation is loading. Please wait.

An Introduction to Computer Networks

Similar presentations


Presentation on theme: "An Introduction to Computer Networks"— Presentation transcript:

1 An Introduction to Computer Networks
Lecture 4: Point-to-Point link University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani Univ. of Tehran Introduction to Computer Network

2 Introduction to Computer Network
Outline Concepts: Data signal Links Link functions Encoding Framing Error Detection Error correction or reliable transmission Univ. of Tehran Introduction to Computer Network

3 Introduction to Computer Network
Data Discrete data: an instance is binary. Computer works with discrete data. Discrete is encoded in 0s and 1s. Continuous data: change with time or space. It is converted to discrete data by sampling Data is delivered by signals in the links Univ. of Tehran Introduction to Computer Network

4 Introduction to Computer Network
Link Functions Signal Adaptor Adaptor Adaptor: convert bits into physical signal and physical signal back into bits Functions Construct Frame with Error Detection Code Encode bit sequence into analog signal Transmit bit sequence on a physical medium (Modulation) Receive analog signal Convert Analog Signal to Bit Sequence Recover errors through error correction and/or ARQ Univ. of Tehran Introduction to Computer Network

5 Introduction to Computer Network
Link Components NRZI Univ. of Tehran Introduction to Computer Network

6 Introduction to Computer Network
Link Properties Function Duplex/Half Duplex One stream, multiple streams Characteristics Bit Error Rate Data Rate (this sometimes mistakenly called bandwidth!) Degradation with distance Univ. of Tehran Introduction to Computer Network

7 Example: Optical Links
Univ. of Tehran Introduction to Computer Network

8 Introduction to Computer Network
Signals Electromagnetic waves propagating in the light speed. Frequency Wavelength A (periodic) signal can be viewed as a sum of sine waves of different frequencies and strengths. Every signal has an equivalent representation in the frequency domain. » What frequencies are present and what is their strength (energy) Univ. of Tehran Introduction to Computer Network

9 Introduction to Computer Network
Signals (cont) Example- The following signal is the sum of sine waves. Univ. of Tehran Introduction to Computer Network

10 Introduction to Computer Network
Modulation Sender changes the nature of the signal in a way that the receiver can recognize. » Similar to radio: AM or FM Digital transmission: encodes the values 0 or 1 in the signal. » It is also possible to encode multi-valued symbols Amplitude modulation: change the strength of the signal, typically between on and off. » Sender and receiver agree on a “rate” » On means 1, Off means 0 Similar: frequency or phase modulation. Can also combine method modulation types. Univ. of Tehran Introduction to Computer Network

11 Introduction to Computer Network
Modulation The function of transmitting the encoded signal over a link, often by combining it with another (carrier signal) E.g. Frequency Modulation (FM) Combine the signal with a carrier signal in such a way that the instantaneous frequency of the received signal contains the information of the carrier E.g. Frequency Hopping (OFDM) Signal transmitted over multiple frequencies Sequence of frequencies is pseudo random Univ. of Tehran Introduction to Computer Network

12 Introduction to Computer Network
Link rate and Distance Links become slower with distance because of attenuation of the signal Amplifiers and repeaters can help Univ. of Tehran Introduction to Computer Network

13 Introduction to Computer Network
Limits in sending signals Noise: “random” energy is added to the signal. Attenuation: some of the energy in the signal leaks away. We need repeaters. Dispersion: attenuation and propagation speed are frequency dependent. » Changes the shape of the signal Univ. of Tehran Introduction to Computer Network

14 Introduction to Computer Network
Noise A signal s(t) sent over a link is generally Distorted by the physical nature of the medium This distortion may be known and reversible at the receiver Affected by random physical effects Shot noise Fading Multipath Effects Also interference from other links Wireless Crosstalk Dealing with noise is what communications engineers do Univ. of Tehran Introduction to Computer Network

15 Noise limits the link rate
Suppose there were no noise E.g. Send s(t) always receive s(t+Δ) Take a message of N bits say b1b2….bN, and send a pulse of amplitude of size 0.b1b2….bN Can send at an arbitrarily high rate This is true even if the link distorts the signal but in a known way In practice the signal always gets distorted in an unpredictable (random) way Receiver tries to estimate the effects but this lowers the effective rate One way to mitigate noise is to jack up the power of the signal Signal to Noise ratio (SNR) measures the extent of the distortion effects Univ. of Tehran Introduction to Computer Network

16 Introduction to Computer Network
Channel capacity Every transmission medium supports transmission in a certain frequency range. This is called channel capacity. » The channel bandwidth is determined by the transmission medium and the nature of the transmitter and receivers A noiseless channel of width H can at most transmit a binary signal at a rate 2 x H. » E.g. a 3000 Hz channel can transmit data at a rate of at most 6000 bits/second Assumes binary amplitude encoding Shannon extended this result by accounting for the effects of noise. More aggressive encoding can increase the channel bandwidth. » Example: modems Univ. of Tehran Introduction to Computer Network

17 Bandwidth affects the data rate
There is usually a fixed range of frequencies at which the analog wave can traverse a link The physical characteristics of the link might govern this Example: Voice Grade Telephone line 300Hz – 3300Hz The bandwidth is 3000Hz For the same SNR, a higher bandwidth gives a higher rate Univ. of Tehran Introduction to Computer Network

18 Signaling bits on a link Multi-level Signaling
2-bits per symbol 3-bits per symbol 8 4 7 6 3 5 Levels Levels 4 2 3 2 1 1 00 11 10 01 00 000 010 101 001 110 Ultimately, what limits the number of bits I can send per symbol? Univ. of Tehran Introduction to Computer Network

19 Maximum Capacity/Data Rate
Shannon Capacity: Bandwidth of link Signal-to-Noise ratio For example: Bandwidth of telephone link from telephone to a typical home is approx 3300Hz – 300Hz = 3kHz Signal-to-noise ratio is approx 30dB = 10log10(S/N) Therefore, C = 3000*log2(1001) ~= 30kb/s Optical fiber has a higher capacity because the bandwidth, B, of a fiber is much greater than for wire; and it is less susceptible to noise, N. Univ. of Tehran Introduction to Computer Network

20 Sampling Result (Nyquist)
Suppose a signal s(t) has a bandwidth B. Sampling Result: Suppose we sample it (accurately) every T seconds. If T≤ 1/2B then it is possible to reconstruct the s(t) correctly Only one signal with bandwidth B has these sample points There are multiple signals with these sample points for signals with bandwidth greater than B Increasing the bandwidth results in a richer signal space No noise allowed in the sampling result Univ. of Tehran Introduction to Computer Network

21 Introduction to Computer Network
Copper Wire Unshielded twisted pair » Two copper wires twisted - avoid antenna effect » Grouped into cables: multiple pairs with common sheath » Category 3 (voice grade) versus category 5 » 100 Mbps up to 100 m, 1 Mbps up to a few km » Cost: ~ 10cents/foot Coax cables. » One connector is placed inside the other connector » Holds the signal in place and keeps out noise » Gigabit up to a km Univ. of Tehran Introduction to Computer Network

22 Introduction to Computer Network
Copper Wire Univ. of Tehran Introduction to Computer Network

23 Introduction to Computer Network
Microwaves High frequency electromagnetic waves (>1GHz) q Line of sight terrestrial transmissions and for communications via satellites. q Some atmospheric interference occurs but reliable transmission can be obtained over distances up to 50 Km. q Microwaves is absorbed by rain and does not penetrate obstacles. Univ. of Tehran Introduction to Computer Network

24 Introduction to Computer Network
Fiber Optic q Thin thread of glass or plastic q Lightweight. q Fibers act as wave-guides for light which is usually produced by lasers. q Visible light has frequency around 5*10 15 Hz, which ensures an extremely high bandwidth. q The raw materials are cheap. q Immune to electrical interference. q Difficult to join and tap. q Security advantages Univ. of Tehran Introduction to Computer Network

25 Introduction to Computer Network
Leased Lines Dedicated link from Telephone Companies DS1 24 digital voice of 64Kbps DS3 28 DS1 STS stands for Synch. Transfer signal Line Bandwidth DS1 (T1) 1.544 Mbps DS3 (T3) Mbps STS-1 (OC1) Mbps STS-3 (OC3) Mbps STS-12 (OC12) Mbps STS-48 (OC48) 2.48 Gbps STS-192 (OC192) 9.95 MGbps Univ. of Tehran Introduction to Computer Network

26 Introduction to Computer Network
Last-Mile Links Connect from home to network service providers xDSl (Digital Subscriber line), runs on local loop on telephone line. ADSL, VDSL CATV- Cabel TV, BW of 6 MHZ, is asymmetric. Line Bandwidth POTS (modem) Kbps ISDN Kbps XDSL 16Kbps-55.2 Mbps CATV 20-40 Mpbs Univ. of Tehran Introduction to Computer Network

27 Introduction to Computer Network
Encoding Goal: send bits from one node to another node on the same physical media Encode binary data onto signals This service is provided by the physical layer Bits flow is between network adaptors. Problem: specify a robust and efficient encoding scheme to achieve this goal How to send clock information? Extract from changes in signals. Univ. of Tehran Introduction to Computer Network

28 Introduction to Computer Network
Encoding (crieria) Criteria for encoding: Bit rate (in limited BW) Recovering time information (in LAN) Error detecting Immunity to noise and interference Complexity and cost of implementation. Bit rates V.s Baud Rates Baud rates is the number of pulses sent over the link or changing in signals. Univ. of Tehran Introduction to Computer Network

29 Introduction to Computer Network
Assumptions We use two discrete signals, high and low, to encode 0 and 1 The transmission is synchronous, i.e., there is a clock used to sample the signal In general, the duration of one bit is equal to one or two clock ticks If the amplitude and duration of the signals is large enough, the receiver can do a reasonable job of looking at the distorted signal and estimating what was sent. Univ. of Tehran Introduction to Computer Network

30 Non-Return to Zero (NRZ)
1  high signal; 0  low signal 1 1 1 1 NRZ (non-return to zero) Clock Univ. of Tehran Introduction to Computer Network

31 Introduction to Computer Network
Problem with NRZ Consecutive 0’s or 1’s may create problems. Synchronization problem because of difference in the sender or receiver clocks. The average of signals which is used to distinguish between low or high may move and make the decoding difficult. This is called baseline wander Unable to recover clock Univ. of Tehran Introduction to Computer Network

32 Non-Return to Zero Inverted (NRZI)
1  make transition; 0  stay at the same level Solve previous problems for long sequences of 1’s, but not for 0’s 1 1 1 1 NRZI (non-return to zero intverted) Clock Univ. of Tehran Introduction to Computer Network

33 Introduction to Computer Network
Manchester 1  high-to-low transition; 0  low-to-high transition Addresses clock recovery and baseline wander problems Disadvantage: needs a clock that is twice as fast as the transmission rate Efficiency of 50% 1 1 1 1 Manchester Clock Univ. of Tehran Introduction to Computer Network

34 Introduction to Computer Network
Encodings (cont) Bits NRZ Clock Manchester NRZI 1 Univ. of Tehran Introduction to Computer Network

35 4-bit/5-bit (100Mb/s Ethernet)
Goal: address inefficiency of Manchester encoding, while avoiding long periods of low/high signals Solution: Use 5 bits to encode every sequence of four bits such that no 5 bit code has more than one leading 0 and two trailing 0’s Use NRZI to encode the 5 bit codes Efficiency is 80% 4-bit 5-bit 4-bit 5-bit Unused code are used for control. I.e is for line idle or for the line is dead. FDDI is using this scheme. Univ. of Tehran Introduction to Computer Network

36 Introduction to Computer Network
Framing How to distinguish between data and garbage. Break sequence of bits into a frame Typically implemented by network adaptor Bits Node A Adaptor Adaptor Node B Frames Univ. of Tehran Introduction to Computer Network

37 Byte-oriented Approaches
Sentinel-based delineate frame with special pattern: or STX, ETX, etc characters. e.g., HDLC, SDLC, PPP Problem: special pattern or characters appear in the payload. Character escaping or stuffing: in BISYNC (from IBM) with DLE character. 8 16 16 8 Beginning Ending Header Body CRC sequence sequence Univ. of Tehran Introduction to Computer Network

38 Byte-oriented Approaches (cont)
Counter-based include payload length in the header e.g., DDCMP protocol from DEC. problem: count field corrupted solution: catch when CRC fails Univ. of Tehran Introduction to Computer Network

39 Bit-oriented Approaches
Frame is a collection of bits, SDLC (IMB) (synch. Data Link Control), later changed to HDLC (high) by OSI Beginning and end with problem: How if the sequence appear in the body. solution: Bit stuffing: add after 5 consecutive 1 a zero. 16 16 8 8 Beginning Sequence Header Body ……. CRC Ending Sequence Univ. of Tehran Introduction to Computer Network

40 Introduction to Computer Network
Clock-Based Framing e.g., SONET: Synchronous Optical Network By Bellcore Use NRZ , but scramble it for enough transition Multiplex multiple low-speed links into a high sp STS-n (STS-1 = Mbps), each frame 125 us Overhead Payload 90 columns 9 rows Univ. of Tehran Introduction to Computer Network

41 Introduction to Computer Network
Error Detection To send extra information to find error in the frame. The simplest form is sending two copies, inefficient. Sending the sum of values (?) in the frame, checksum. In Internet, consider 16 bits sequences and then use one-complement to find the result. Sending parity, Odd or even parity. Two dimensional parity. Univ. of Tehran Introduction to Computer Network

42 Error Detecting (goals)
Reduce overhead, i.e., reduce the number of redundancy bits Increase the number and the type of bit error patterns that can be detected Univ. of Tehran Introduction to Computer Network

43 Internet Checksum Algorithm
View message as a sequence of 16-bit integers; sum using 16-bit ones-complement arithmetic; take ones-complement of the result. u_short cksum(u_short *buf, int count) { register u_long sum = 0; while (count--) sum += *buf++; if (sum & 0xFFFF0000) /* carry occurred, so wrap around */ sum &= 0xFFFF; sum++; } return ~(sum & 0xFFFF); Univ. of Tehran Introduction to Computer Network

44 Introduction to Computer Network
Even Parity Check EDC field has 1 bit Sender: If number of 1’s in payload is odd, the check bit is 1, else it is 0 Receiver: Accept the packet if payload number of 1’s match the value of the check bit. Can detect an odd number of bit errors Univ. of Tehran Introduction to Computer Network

45 Two-dimensional Parity
Add one extra bit to a 7-bit code such that the number of 1’s in the resulting 8 bits is even (for even parity, and odd for odd parity) Add a parity byte for the packet Example: five 7-bit character packet, even parity 1 1 1 1 Univ. of Tehran Introduction to Computer Network

46 How Many Errors Can you Detect?
All 1-bit errors Example: 1 1 odd number of 1’s error bit 1 Can detect AND correct 1-bit errors 1 Univ. of Tehran Introduction to Computer Network

47 Cyclic Redundancy Code (CRC)
Add r bits of redundant data to an n-bit message Where r << n e.g., r= 32 and n = 12,000 (1500 bytes) T R M r m MSB i.e. T = M.2r + R Modulo-2 addition (XOR) Univ. of Tehran Introduction to Computer Network

48 Introduction to Computer Network
CRC(cont) Represent n-bit message as n-1 degree polynomial e.g., MSG= as M(x) = x7 + x4 + x3 + x1 Let k be the degree of some divisor polynomial e.g., C(x) = x3 + x2 + 1 Transmit polynomial T (x) that is evenly divisible by C(x) shift left k bits, i.e., M(x)xk subtract remainder of M(x)xk / C(x) from M(x)xk Univ. of Tehran Introduction to Computer Network

49 Introduction to Computer Network
CRC (cont) Receiver polynomial T(x) + E(x) E(x) = 0 implies no errors Divide (T(x) + E(x)) by C(x); remainder zero if: E(x) was zero (no error), or E(x) is exactly divisible by C(x) All operation is done in modulo 2 in which there is no carry. Then, the operation can be done by XOR only. Univ. of Tehran Introduction to Computer Network

50 Introduction to Computer Network
CRC(cont) Example: M(x)= , C(x) = 1001 0 1 1 The final transmitted message is: T(x) = R Univ. of Tehran Introduction to Computer Network

51 Introduction to Computer Network
Selecting C(x) All single-bit errors, as long as the xk and x0 terms have non-zero coefficients. All double-bit errors, as long as C(x) contains 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 (i.e., sequence of consecutive error bits) for which the length of the burst is less than k bits. Most burst errors of larger than k bits can also be detected See Table 2.6 on page 102 for common C(x) Univ. of Tehran Introduction to Computer Network

52 Introduction to Computer Network
Hamming Distance Given codewords A and B, the Hamming distance between them is the number of bits in A that need to be flipped to turn it into B Example H(011101,000000)=4 If all codewords are at least d Hamming distance apart, then up to d-1 bit errors can be detected Univ. of Tehran Introduction to Computer Network

53 Reliable Transmission
Error detection code Very costly Acknowledgment and timeout Send Acks in opposite direction. Retransmit if sender did not receive Ack. Univ. of Tehran Introduction to Computer Network

54 Acknowledgements & Timeouts
Sender Receiver Sender Receiver Frame Frame Timeout Timeout ACK ACK T T Time Frame Timeout T ACK (a) (c) Receiver Sender Receiver Sender Frame Frame imeout imeout ACK T T Frame Frame imeout imeout T ACK T ACK Univ. of Tehran (b) Introduction to Computer Network (d)

55 Introduction to Computer Network
Stop-and-Wait Sender Receiver Problem 1: keeping the pipe full Example 1.5Mbps link x 45ms RTT = 67.5Kb (8KB) 1KB frames imples 1/8th link utilization Problem 2: How about repeated frames? Add a sequence number to frames. Univ. of Tehran Introduction to Computer Network

56 Introduction to Computer Network
Sliding Window Allow multiple outstanding (un-ACKed) frames Upper bound on un-ACKed frames, called window Sender Receiver T ime Univ. of Tehran Introduction to Computer Network

57 Introduction to Computer Network
SW: Sender Assign sequence number to each frame (SeqNum) Maintain three state variables: send window size (SWS) last acknowledgment received (LAR) last frame sent (LFS) Maintain invariant: LFS - LAR <= SWS Advance LAR when ACK arrives Buffer up to SWS frames SWS LAR LFS Univ. of Tehran Introduction to Computer Network

58 Introduction to Computer Network
SW: Receiver Maintain three state variables receive window size (RWS) largest frame acceptable (LFA) last frame received (LFR) Maintain invariant: LFA - LFR <= RWS Frame SeqNum arrives: if LFR < SeqNum < = LFA accept if SeqNum < = LFR or SeqNum > LFA discarded Send cumulative ACKs RWS LFR LFA Univ. of Tehran Introduction to Computer Network

59 Introduction to Computer Network
Sequence Number Space SeqNum field is finite; sequence numbers wrap around Sequence number space must be larger then number of outstanding frames SWS <= MaxSeqNum-1 is not sufficient suppose 3-bit SeqNum field (0..7) SWS=RWS=7 sender transmit frames 0..6 arrive successfully, but ACKs lost sender retransmits 0..6 receiver expecting 7, 0..5, but receives second incarnation of 0..5 SWS < (MaxSeqNum+1)/2 is correct rule Intuitively, SeqNum “slides” between two halves of sequence number space Univ. of Tehran Introduction to Computer Network

60 Concurrent Logical Channels
Multiplex 8 logical channels over a single link Run stop-and-wait on each logical channel Maintain three state bits per channel channel busy current sequence number out next sequence number in Header: 3-bit channel num, 1-bit sequence num 4-bits total same as sliding window protocol Separates reliability from order Univ. of Tehran Introduction to Computer Network


Download ppt "An Introduction to Computer Networks"

Similar presentations


Ads by Google