Chapter 2: Computer Networks 2.1: Physical Layer: representation of digital signals 2.2: Data Link Layer: error protection and access control 2.3: Network infrastructure 2.4 2.5: Local Area Network examples 2.6: Wide Area Network examples 2.7: DSL as Last Mile network Chapter 4: Application Protocols Chapter 3: Internet Protocols OSI Reference Model Application Layer Presentation Layer Session Layer Transport Layer Network Layer Data Link Layer Computer Networks Physical Layer Page 1
Sicherungsebene Lehrstuhl für Informatik 4 Layer 2: Division into two Parts Logical Link Control (LLC) (Layer 2b) Organization of the data to be sent into frames Guarantee (if possible) an error free transmission between neighboring nodes through: Detection (and recovery) of transfer errors Flow Control (avoidance of overloading the receiver) Buffer Management Medium Access Control (MAC) (Layer 2a) Control of the access to the communication channel in broadcast networks Data Link Layer LLC MAC 82.3 CSMA/CD (Ethernet) 82.4 Token Bus IEEE 82.2 Logical Link Control 82.5 Token Ring 82.6 DQDB ANSI X3T9.5 FDDI ATM Forum ATM LAN Emulation...... ISO/OSI Concrete Reale Netze Networks Page 2
LLC: Frame Construction Organization of a message into uniform units (for simpler transmission) Well-defined interface to the upper layer (layer 3) Marking of the units: Header Data Trailer Error check (checking sequence for the frame) Control information (addresses, frame numbers, ) FCS = Frame Checking Sequence (Physical) mark the frame by: Start and end flags Start flag and length Code injuries Next task of the LLC layer: protected transmission of the frames to the communication partner. The transmission over layer 1 is not necessarily free of errors! Question: how can errors be recognized and repaired? Addresses used here: MAC address i.e. physical address of a network interface card Page 3
Error-detecting and -correcting Codes From the data, compute a short checksum and send it together with the data to the receiver. The receiver also computes a checksum from the received data and compares it with those of the sender. Simplest procedure - parity bit: count the number of 1s: Odd Bit errors are detected Sender: 11111 PB: 1 sent: 111111 Even Bit errors are not detected Receiver: 11111 PB computed: Corrections are not possible! The receiver can detect that there is an error, but not which bit is damaged Variant: double parity Improvement of the parity bit procedure by further parity bits. For this, several blocks of bits are grouped and treated together: Sender: 111 1 Receiver: 111 1 1 1 11 11 11 11 11 11 111 An incorrect bit can be identified and corrected by this procedure. But errors comprising several bits, no corrections are possible. Also, there are certain error patterns which even cannot be detected with this method! Also, wrong corrections are possible! Page 4
Error-correcting Codes Error correction Error correction generally means: Transmission of redundancies Length of the transmission: n bit (2 n possible binary sequences) Message length: m (<n) bit (2 m permissible code words) k parity (redundancy) bits (k = n - m) Form a sphere of code words around each message Hamming Distance D: Number of places, in which two binary sequences differ Then: D 2t + 1 code is t-error-correcting D t + 1 code is t-error-detecting That means: for error-correction, a relatively large overhead has to be transmitted and it is not guaranteed, that the identified correction really is the right one. Page 5
Hamming Code Goal: Use of several parity bits, each of them considering several bits (overlapping). Errors can be identified and corrected by combining the parity bits. The Hamming code is the minimal code of this category. Idea: Representation of each natural number by sum of powers to two. In a code word w = z 1,, z n the parity bits are placed exactly at the k positions, for them the index is a power of two. At the remaining m = n - k positions the data bits are placed. Each of the k additional bits is a parity bit for all places, for which the representation in powers of two contains the position of the additional bit. Page 6
Hamming Code Parity bit 1 2 4 8 ASCII-Code H 11 A 111 M 11111 M 11111 I 1111 N 11111 G 11111 Checks data bits 3, 5, 7, 9, 11 3, 6, 7, 1, 11 5, 6, 7 9, 1, 11 Problem with Hamming code: errors involving several following bits are usually wrongly corrected Codeword 1 2 3 4 5 6 7 8 9 1 11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Data bit position = sum of checkbit positions: 3 = 1 + 2 5 = 1 + 4 6 = 2 + 4 7 = 1 + 2 + 4 9 = 1 + 8 1 = 2 + 8 11 = 1 + 2 + 8 Receiver: examine parity bits if necessary, sum up indices of the incorrect parity bits index of the incorrect bit 1-bit errors can definitely be identified and corrected Page 7
Hamming Code 111 Transmission error 11 Receiver computes parity bits: 111 Summing up the indices 1, 2 and 4, bit 7 is detected as false Weaknesses: 2-bit errors are not corrected (or wrongly corrected!) 3-bit errors are not recognized a) Bit 4 and bit 11 inverted: parity bits 1, 2, 4, 8 are wrong bit 15 is to be corrected, but does not exist b) Bit 2 and bit 4 inverted parity bits 2, 4 wrong bit 6 is falsely recognized as incorrect c) Bits 1, 8, 9 inverted all parity bits are correct no error is recognized Page 8
Error Detection with Cyclic Codes Problem: how to recognize errors in several bits, especially sequences of bit errors? The use of simple parity bits is not suitable. However, in data communication (modem, telephone cables) such errors arise frequently. Most often used: Polynomial Codes Idea: a k-bit PDU (a k-1,, a ) is seen as a polynomial a k-1 x k-1 + + a with the coefficients and 1. Example: 1111 is seen as x 6... x 1 x = x 6 + x 5 + x 2 + 1 For computations, polynomial arithmetic modulo 2 is used, i.e. addition and subtraction without carry. Both operations become Exclusive-OR operations. Page 9
Error Detection with Cyclic Codes Idea for error detection: Sender and receiver agree upon a generator polynomial G(x) = x r + + x. The first and the last coefficient have to be 1. The sender interprets a data block of length m as polynomial M(x). The sender extends M(x), i.e. adds redundant bits in a way that the extended polynomial M (x) is divisible by G(x). (Redundancy = remainder R(x) by division of the sequence with G(x)) The receiver divides the received extended M(x) by G(x). If the remainder is, there was no error, otherwise some error occurred. Name: Cyclic Redundancy Checksum (CRC) Note: also the parity bit can be seen as CRC, with generator polynomial x + 1! Page 1
CRC - Example Data to be transmitted: 11111 Generator polynomial: x 4 + x +1 Note: usually, the extra positions are preset with zeros but on some reason e.g. Ethernet uses the inverted bits as presets. Note: divisor using modulo-2 aritchmetic! Sender: 11111 : 111 = 11111 111 1 111 111 111 1111 111 111 111 11 = x 3 + 1 = R(x) CRC = 11, sending 1111111 Receiver: 1111111 : 111 = 11111 111 1 111 1111 111 111 111 111 111 Data received correctly Page 11
Computation of CRC: Shift Registers Implementation by Shift Registers: XOR for substraction AND for applying substraction: first register = : no substraction first register = 1: substraction Generator polynomial x 4 + x +1: R R R R R 1 1 1 Simplified realization: R R R R R When no more input is given in the leftmost register, the other registers contain the CRC result. Page 12
Shift Registers - Example Data to be transmitted: 11111 Generator polynomial: x 4 + x +1 11111 Sent data Sent data 1 1 1111 Sent data 1 1 1111 Page 13
Shift Registers - Example Sent data 11 1 1 111 Sent data 111 1 1 1 11 Sent data 1111 1 1 1 1 1 1 1 Sent data 1111 1 1 Page 14
Shift Registers - Example Sent data 1111 1 1 1 1 11111 Sent data 1 1 1 11111 Sent data 1 1 1 11111 Sent data 1 1 1 1 1 Page 15
Shift Registers - Example 11111 Sent data 1 1 1 1 1 1 11111 Sent data 1 1 1 1 1 111111 Sent data 1 1 x 1 1 111111 Sent data x 1 x Page 16
Shift Registers - Example 111111 Sent data x x 1 x 1111111 Sent data x x x 1 x 1111111 Sent data x x x x x Page 17
CRC is not perfect Receiver: 1111 : 111 = 1111 111 1111 111 111 111 11 111 11 Error detected Receiver: 111111 : 111 = 111111 111 1111 111 111 111 1111 111 111 111 111 111 Error not detected Page 18
CRC: Characteristics Common generator polynomials: CRC-16: G(x) = x 16 + x 15 + x 2 +1 CRC CCITT: G(x) = x 16 + x 12 + x 5 +1 Ethernet: G(x) = x 32 + x 26 + x 23 + x 22 + x 16 + x 12 + x 11 + x 1 + x 8 + x 7 + x 5 + x 4 + x 2 + x + 1 Error detection (for 16-bit generator polynomials): all single bit errors all double bit errors all three-bit errors all error samples with odd number of bit errors all error bursts with 16 or fewer bits 99.997% of all 17-bit error bursts 99.998% of all error bursts with length 18 bits Remaining error rate <.5 * 1-5 block error rate (original) Page 19
CRC is not perfect 1.) There are still remaining some error-combinations which can occur undetected the probability is very small, but in principle it is possible 2.) Assume, the receiver only gets part of the original message: Header / Data FCS Header / Data The receiver interprets the end of the message as FCS and tries to check the rest of the received bits as sent data. Probability for assumed FCS = FCS for assumed data : 1/2 r for r-bit FCS, because each of the r bits is correct with probability ½. This problem can be eliminated by using a fixed byte structure for the data frame or a length field in the header. 3.) An error could consist of adding a multiple of G(x) to M (x) Page 2
CRC: Error Correction In exceptional cases even errors are correctable by CRCs. Example: ATM (Asynchronous Transfer Mode) Data units have fixed length 5 byte header + 48 byte data The last header byte is a checksum for the header Generator polynomial G(x) = x 8 + x 2 + x +1 It is even possible to correct a 1-bit error, due to: there are 4 possible 1-bit errors and those lead on 4 different non-zero remainders. Correction is not assigned with e.g. Ethernet: an Ethernet frame has a length between 64 and 1512 byte. Page 21
Error Protection Mechanisms Error correction: FEC (Forward Error Correction) Use of error-correcting codes Erroneous data in most cases can be corrected. Uncorrectable data are simply dismissed. Feedback from the receiver to the sender is not necessary. Suitable for transmissions tolerating no transmission delays (video, audio) as well as for coding resp. protecting data on CDs or DVDs. Error detection: ARQ (Automatic Repeat Request) Use of error-detecting codes (CRC) Errors are detected, but cannot be corrected. Therefore, erroneous data must be requested again. Introduction of flow control: number the data blocks to be sent acknowledgement of blocks by the receiver incorrectly transferred blocks are repeated Suitable for transmissions which do not tolerate errors (files). Page 22
Flow Control: Send and Wait Simple procedure: The sender sends a data block and waits, until an acknowledgement of the receiver arrives or a timeout is reached. Incorrect blocks are repeated, otherwise the next block is sent. Disadvantage: large waiting periods between the transmission of single blocks. Thus much transmission capacity is wasted. Waiting period Transmitter 1 2 2 3 ACK time out ACK Receiver 1 F 2 3 ACK: Acknowledgment, i.e. everything ok Timeout: we count to a certain time after sending of a packet; if no ACK has been received till this time, we can be sure that none will arrive any more repeat data Page 23
Flow Control: Sliding Window Introduction of a transmission window Common procedure to avoid long waiting periods of the sender Sender and receiver agree upon a transmission window. If W is the window size, it means: the sender may send maximally W messages without an acknowledgement of the receiver. He has to provide W buffer places to store the sent messages till they are acknowledged. The messages are sequentially numbered in the frame header (, 1, 2,, MODULUS-1,, ; whereby W < MODULUS). The sender may send sequentially numbered messages up to W, without getting an acknowledgement for the first frame. The receiver confirms by acknowledgements (ACK). The sender moves the window as soon as an ACK arrives. Advantages of the procedure: The sender can take advantage of the network capacity A sender who is too fast for the receiver is slowed down (the receiver only can read data from the network slowly, thus it rarely sends ACKs) Sending and receiving speed are adapted Page 24
Sliding Window Example (for 3-bit sequence/acknowledgement number) with 3 bits for sequence/acknowledgement number, m = 8 possible combinations Stations agree upon a window size W with 1 W < m, e.g. W = 7 The window limits the number of unconfirmed frames allowed at one time (here max. 7, because of W = 7) With receipt of an acknowledgement, the window is shifted accordingly Frames are numbered sequentially modulo m (for m = 8 thus numbers from to 7) 7 7 ACK 6 ACK 2 ACK 6 1 6 1 5 2 5 2 5 2 5 2 5 2 41 3 2 3 4 4 5 3 6 7 4 1 3 2 3 4 4 53 6 7 4 13 2 6 7 Station Station sendet sends Station Station receives erhält Station Station verschiebt slides Station Station receives erhält Station Station verschiebt slides Frames - Quittung Fenster um 1, Quittung 1, 2 Fenster um 2, frames - 6 acknowledgement sendet window Frame by 1 7 acknowledgement sendet window Frame by, 2 Time 1 and sends 1,2 and sends frame 7 frames,1 1 6 7 1 6 7 1 Page 25
Maximum Window Size with Sliding Window There is a reason why window size W has to be smaller than MODULUS: Sequence numbers e.g. have 3 bits: 2 3 = 8 sequence numbers (,, 7) I.e. MODULUS = 8 Assume the window size to be W = 8. A sends frames to B. A has recently received an ACK for frame 2; A is allowed to send 8 more frames 3 4 5 6 7 1 2 A receives ACK 2. There are two possibilities: Case 1: B only has received 1 2 and retransmits the (old) number ACK number. Everything in between has been lost. Case 2: B has received 1 2 3 4 5 6 7 1 2 and confirms the (new) number 2 (all ACKs may have been lost or forgotten in between) A does not know whether case 1 or 2 holds: the ACK is ambiguous! W must be less than 8 (W < MODULUS in general). Page 26
Elimination of Errors: Go-back-n The sender sends data blocks (within the transmission window). The receiver answers: ACK j : everything up to block j is correct REJ j /NACK j : up to block j-1 everything is correct, block j is incorrect (in usual implementations, timeouts are used instead of such negative acknowledgements) Go-back-n: with a REJ j, starting from block j everything is transferred again Disadvantage: With a REJ j the transmitter must repeat all blocks starting from j Advantage: the receiver needs only one buffer place Example of W = 5; MODULUS = 8 Source 1 2 3 4 5 2 3 4 5 6 Destination ACK ACK 1 REJ 2 ACK 2 Page 27
Extensions Lehrstuhl für Informatik 4 Selective Repeat SREPEAT: Only positive acknowledgements are given When a PDU is missing, the receiver buffers the following (correct) PDUs If the sender gets no acknowledgement for a PDU, a timeout occurs and the sender repeats (like in go-back-n) everything beginning with the missing PDU When the missing PDU arrives, an acknowledgement for the subsequently received PDUs is sent When the sender gets this acknowledgement, it stops repeating old PDUs and goes on with new PDUs Thus, the capacity is used more efficiently, but the receiver needs more buffer Selective Reject SREJ j Like in SREPEAT, correctly received PDUs after a missing PDU are buffered The receiver gives a negative acknowledgement for the missing PDU j The sender repeats only PDU j. By this, no unnecessary duplicates are sent, the efficiency of capacity usage again is enhanced. Variant: the receiver can send a list of missing PDUs to the sender, not only single negative acknowledgements But: again the receiver needs more buffer. Page 28
Retransmission Strategies Timeout interval Sender 1 2 3 4 5 6 7 8 9 1 11 2 3 4 5 6 7 8 9 1 ACK 1 Receiver ACK 2 ACK 3 1 2 3 4 5 6 7 8 9 1 Go-Back-N Timeout interval Sender 1 2 3 4 5 6 7 8 9 1 11 2 3 4 5 6 7 8 12 13 ACK 1 ACK 11 Receiver 1 3 4 5 6 7 8 9 1 11 2 12 13 Selective Repeat Timeout interval Sender 1 2 3 4 5 6 7 8 9 2 1 11 12 13 14 15 16 17 18 19 ACK 1 NACK 2 ACK 9 Receiver 1 3 4 5 6 7 8 9 2 1 11 12 13 14 15 16 17 18 19 Selective Reject Page 29
Implementation of Protocols Example of use: Implementation of a protocol for layer 2 First: Definition of some data types (protocol.h): Page 3
Page 31
Step 1: Send without restrictions No transmission errors No flow control Page 32
Step 2: Simple flow control No transmission errors Send-and-Wait as flow control Page 33
Step 3: Error handling and flow control - sender Page 34
Step 3: Error handling and flow control - receiver Page 35
SDLC (Synchronous Data Link Control) Protocol for layer 2: SDLC Developed for a ring network with one (coordinating) master and any number of slaves The communication is subdivided in two phases: 1.) The master sends to all slaves 2.) The slaves can send back data to the master Phase 1 Simple: the master sends out data Data is received by all slaves one after the other Each slave checks the destination address of the incoming frame Only the addressed station copies the data All stations (even the receiver) forward the data on the ring The master gets back its frame and takes it from the ring But: how to avoid that all slaves send simultaneously in phase 2? Page 36
SDLC Phase 2 The master starts to send out a sequence of 1s after finishing phase 1 Used on layer 1 is inverted differential NRZ code, i.e. to change of voltage level is done Assume a stability time of 1 bit, i.e. stations stay synchronized for at least 1 bit A slave which wants to sent counts incoming 1s and changes the 7 th bit to After this, the station can sent out its data When all data are sent, the station repeats the sequence of 1s, thus the next slave on the ring can do the same procedure Thus, all slaves are coordinated to send one after the other; the messages of them are separated by the pattern 111111 : [message 1 ]111111[message 2 ]111111[message 3 ].[message n ]1111111 A station which does not want to send anything, simply let pass the sequence of 1s The master detects that all slaves have sent when it receives at least seven 1s in sequence Page 37
Bitstuffing Lehrstuhl für Informatik 4 Frame identification: All messages in SDLC are by this marked at the beginning and end with a flag: 111111 Flag may never occur within a frame Used for this purpose: Bitstuffing Sender inserts a zero after each sequence of five ones. The receiver removes this zero. Sender: 11111111 Receiver: 11111111 11111111 11111111 Page 38
High Level Data Link Control (HDLC) 8 8 8 (16) 16 8 111111 Address Control DATA FCS 111111 Flag Header Data Trailer Flag Bits For synchronization on layer 1 D/C N(S) P/F N(R) D/C: DATA () resp. control (1) P/F: Poll/final for the coordination of several senders HDLC bases on the SDLC principles, but for any network, not only for rings: The flag 111111 is used to announce start and end of a frame (basing on SDLC) Address contains the physical address of the receiver, based on the SDLC address format The checksum is computed by using a CRC Since CRC conducts no error correction, flow control is necessary. Control contains the sequence number N(S) for the message; at the same time, in the opposite direction a message can be acknowledged using the acknowledgement number N(R) ( Piggybacking ). Page 39
Frame Types for HDLC Information I-Frame I-Rahmen Sequence number N(S) P F Acknowledgement number N(R) Supervisory S-Frame S-Rahmen 1 S S P F N(R) Unnumbered U-Frame U-Rahmen 1 1 M M P F M M M N(S) Sequence Number N(R) Acknowledgement Number (Frame N(R) is expected next all frames up to N(R)- 1 are acknowledged, counted modulo the maximum sequence number plus 1.) with 3 bit for N(S) and N(R), only a window size of 7 is possible; long signal transmission time, low data transmission rates Solution: Extended numbering mode with additional control byte (2 * 4 bits) 7 bits per direction, window size W 127 Page 4
Frame Types for HDLC Type I Name I (Data Frame) RR (Receive Ready) RNR (Receive not Ready) S REJ (Reject) SREJ (Selective Reject) SABM (Set Asynchronous Balanced Mode) DISC (Disconnect) UA U (Unnumbered ACK) CMDR (Command Reject) FRMR (Frame Reject) DM (Disconnect Mode) Fields 1 2 3 4 5 6 7 8 N(S) 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 P P/ F P/ F P/ F P/ F P P F F F F N(R) N(R) N(R) N(R) N(R) 1 1 1 1 1 1 Send frame N(S), ACK up to N(R) -1 in the other direction Ready to receive, ACK up to N(R) -1 in the other direction Temporarily not ready to receive, acknowledge up to N(R) -1 in the other direction NACK for N(R), ACK up to N(R)-1. The sender should repeat everything beginning with N(R) ACK up to N(R)-1, selective NACK for N(R) Connection Establishment Announcement of connection termination General ACK (e.g. for connection establishment) Frame/command not valid (invalid frame, wrong sequence number, ) Connection Termination Page 41
PPP Point-to-Point Protocol Often used: point-to-point connections between network nodes Variant of HDLC for point-to-point connections: PPP The structure of frames is oriented at HDLC: Flag: same as for HDLC Address: unnecessary, therefore set to 11111111 Control: unnumbered mode (marked by 11) without sequence numbers and acknowledgments as default procedure Protocol: specifies contents of the data part (Payload), i.e. contains an identifier to inform the receiver about what to do. 11 means IP protocol used for processing the data. Checksum: 2 byte error detection is usually used Page 42
Medium Access Control (MAC) Controlling the competitive access of several users to a shared medium Simplest procedures: firm assignment of a limited capacity Time Division Multiple Access (TDMA) Frequency 1 2 3 3 1 2 3 3 1 2 3 3 1 Time Each user gets the entire transmission capacity for fixed time intervals (Baseband transmission) Frequency Division Multiple Access (FDMA) User 1 User 2 User 3 Frequency Time Each user gets a fixed portion of the transmission capacity (a frequency range) for the whole time (Broadband transmission) Page 43
MAC - Reservation Protocols But: deterministic schemes like TDMA or FDMA are not suited for sporadic but bursty traffic use more flexible schemas, e.g. reservation schemas: Communication follows a two-phase schema (alternating phases): In the reservation phase the sender makes a reservation by indicating the wish to send data (or even the length of the data to be sent) In the transmission phase the data communication takes place (after successful reservation) Advantage: very efficient use of the capacity Disadvantage: Delay by two-phase procedure; further, often a master station is needed, which cyclically queries all other stations whether they have to send data. This master station assigns sending rights. Techniques for easy reservation without master station: Explicit reservation Implicit reservation Page 44
Explicit Reservation Uses two frame types: reservation frame (very small) in the first phase data frame (constant length) in the second phase Variant 1: without contention Only suitable for small number of users Each user i is assigned the i-th slot in the reservation frame. If it wants to send data, it sets the i-th bit in the reservation frame to 1. After the reservation phase, all stations having set their reservation bit can send their data in the order of their bits in the reservation frame. reservation frame data frames of stations having reserved 1 1 1 2 5 7 1 4 1 1 1 1 This procedure is called Bitmap Protocol Page 45
Explicit Reservation Variant 2: with contention For higher number of users The reservation frame consists of a limited number of contention slots (smaller than the number of participating stations) Users try to get a contention slot (and by that make a reservation for a data slot) by random choice, writing their station number into a slot If there is no collision in the reservation phase, a station may send. reservation frame with contention slots data frames of stations having reserved 22 31 5 22 31 34 17 45 4 17 45 4 11 11 25 12 But: after a collision, the colliding stations would in the next phase try again to do a reservation and if there are lots of participants in the network, the risk is very high to try again in a slot where some other station does a reservation for the first time try again, and again, till the whole reservation phase is blocked with more and more stations which had collisions! Page 46
Implicit Reservation No reservation slots, only data slots of fixed length A window consists of N data slots, windows a cyclically repeated The duration of the window must be longer than the round-trip time Procedure: A station which wants to send observes N slots without sending messages and marks the slots as follows:, if the slot if empty or collided 1, if the slot is successfully used by somebody else In the following window the station randomly chooses one of the slots marked with for sending its messages Two cases: conflict: try again successful transmission: slot reserved for the station as long as it sends data. If the station is not using its slot in one window, the reservation is dismissed. Page 47
Implicit Reservation Example: 8 data slots, Stations A - F Reservation Slots: 1 2 3 4 5 6 7 8 Window 1 Stations observing 8 slots ACDABA-F Window 2 A C D A B A B/D F Collision within slot 7; the other slots are reserved Window 3 A C A B A AC-ABA-- Window 4 A B/F B A F A---BAF- Window 5 A B A F D A---BAFD Window 6 A C E E B A F D t Small problem: after the end of a transmission, one slot remains empty (waste of capacity) Modificaton: insert a last slot used signal in its last data frame Page 48
MAC Coordination by using a Token Introduction of a token (determined bit sequence) Only the holder of the token is allowed to send Token is cyclically passed on between all stations particularly suitable for ring topologies (similar principle to SDLC, but without necessity for a master) Token Ring (4/16/1 Mbit/s) Passing on of the token Characteristics: Guaranteed accesses, no collisions Very good utilization of the network capacity, high efficiency Fair, guaranteed response times Possible: multiple tokens But: complex and expensive Page 49
MAC Decentralized Protocols Best known protocol has the name ALOHA Developed on the Hawaiian islands: stations are connected by satellite Very simple principle, no coordination: Stations are sending completely uncoordinated, all using the same frequencies When two (or more) stations are sending at the same time, a collision occurs: both messages are destroyed. Problem: collisions occur even with very small overlaps! Vulnerability period: 2 times the length of a frame When a collision occurs, frames are repeated after a random time Problem: since traffic runs over a satellite, a sender only hears after very long time, whether the transmission was successful or not. Collision Sender A Sender B Sender C t Page 5
MAC Decentralized Protocols Problem with ALOHA: even small laps already lead to transmission conflicts. Therefore often collisions arise, causing many repetitions: No guaranteed response times Low throughput Improvement: Slotted ALOHA The whole time axis is divided into time slots (similar to TDMA, but time slots are not firmly assigned to stations) The transmission of a block starts at the beginning of a time slot fewer collisions, vulnerability period of one frame length But: the stations must be synchronized! Collision Sender A Sender B Sender C t Page 51
How to estimate the Efficiency of ALOHA? Which possible states do we have in ALOHA? G: average number of frames per time unit thinking users no conflict S: throughput, i.e. rate of successful transmissions Relation between G and S? common channel Depends significantly on the traffic structure. backlogged users total traffic G conflict Model A: only one sender. No collisions, so S = G is possible Model B: many users, each of them inactive most time new arrivals are totally random Page 52
Randomness Lehrstuhl für Informatik 4 Suppose that the total traffic is absolutely random. What is the biggest randomness possible? arrival Random arrivals: consider time interval of length h. Observe arrivals in that interval. h Arrivals have a certain intensity G (average rate per time unit) Randomness : probability of an arrival in a (small) time interval h is proportional to the intensity G o( h) to h h... to G h For very small h, only or 1 arrivals are possible: Prob(exactly one arrival within interval length h) = G h + o(h) Prob(no arrivals within interval length h) = 1 G h + o(h) o(h): disturbance function with for h t Page 53
Application for ALOHA access protocol These conditions/requirements lead to the Poisson distribution. Consider the total number i of events in an interval of length T Prob(exactly i arrivals in [;T]) = ( G T) i! Back to ALOHA: relation between S and G Suppose that G follows the poisson distribution, i.e. G is totally random. i e G T S = G Prob(no collision occurs) = G Prob(nobody else started in my vulnerability period) = G Prob(no arrival in interval of length T = 2) for pure ALOHA G Prob(no arrival in interval of length T = 1) for slotted ALOHA Prob( arrivals in [;T]) = e -G T = G e -2G for pure ALOHA G e -G for slotted ALOHA Note: randomness (i.e. Poisson) is not valid for high traffic and if waiting time after retransmission is short Page 54
Throughput vs. Offered Traffic Analytical computation: Both, Pure ALOHA and Slotted ALOHA cannot achieve a high throughput But: simple principle, no coordination necessary between the stations Page 55
MAC Decentralized Protocols Variant of ALOHA for networks with small range exists Similar to ALOHA: no coordination of the stations But: each station which wants to send first examines whether already another station is sending If no sending takes place, the station begins to send (Carrier Sense Multiple Access, CSMA) Notice: this principle only works within networks having a short transmission delay using the principle within satellite systems is not possible because there would be no chance to know whether a conflict occurred before end of the transmission Advantages: simple, because no master station and no tokens are needed; nevertheless good utilization of the network capacity Disadvantage: no guaranteed medium access, a large delay up to beginning a transmission is possible Page 56
Conclusion Lehrstuhl für Informatik 4 For building up computer networks, functionality is needed corresponding to the lowest two layers (regarding ISO/OSI reference model): Layer 1 Determines physical parameters like medium, pin usage in connectors, number of tension level changes per second (which defines data rate on copper cable) Cable codes to represent single bits on a copper medium Layer 2 Consideration of frames, i.e. grouping of bits to be able to detect transmission errors LLC sublayer: Treatment with transmission errors, either by error detecting or error correcting codes; flow control for avoiding overload of the receiver Additionally: MAC sublayer: Determines medium access in broadband networks to coordinate the transmissions of several stations Page 57