Download presentation
Presentation is loading. Please wait.
Published byJohn Adams Modified over 9 years ago
1
Computer Communication and Distributed Algorithms 202-2-1131 Data link layer © תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012) 1
2
© Data link layer Application Physical Link Network Transport Session Presentation The 7-layer OSI Model 2 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
3
© Data link layer Motivation: The basics of the data link service: Error detection and correction. Multiplexing – Multiple access to the channel Accessing network resources using the link layer. Representation of different Link layer technologies Overview: Link layer services Error detection and correction. Multiplexing protocols and local networks (LANs). Link layer technologies: Ethernet – Local area network protocol. 3 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
4
©4 Data Link Layer services תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
5
© Data link layer – Communication framework PDU (protocol data unit) – Data is transferred as units. May include control data, addresses, or content. 5 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
6
© Physicly connecting two devices. host-router, router-router, host-host Data unit: A frame. application transport network link physical network link physical M M M M H t H t H n H t H n H l M H t H n H l frame phys. link data link protocol adapter card Data link layer- Communication framework 6 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
7
© Data link layer services Discrete messages, channel access: Framing the data, adding a header and a trailer A physical address to every header to identify source and destination. The physical address is not the IP address A reliable delivery between two connected physical devices: Low throughput with low noise is rarely used. Usually a wireless channel with errors is used. 7 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
8
© Data link layer services Flow control: Controlling the data transmission between two computers (Sender and receiver). Error detection: Occur as a result of weakening the signal along the cables, and noise. The receiver detects the presence of errors. Sender retransmits. The receiver solves the problem by himself. Error correction: The receiver identifies the bit errors without retransmission Named FEC – Forward error correction. 8 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
9
Implementation Adapter – An extension card connected to the motherboard. E.g. Ethernet card. Usually includes RAM, Link interface, host bus. adapter card application transport network link physical network link physical M M M M H t H t H n H t H n H l M H t H n H l frame phys. link data link protocol 9 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012) ©
10
©10 מסגרות (Frames) תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
11
© Motivation In stead of sending the data in one block, we break the data to a series of frames: Allows a smaller buffer size. When the sending time is longer the probability for an error is bigger, and retransmission is needed. Better use of shared resources. (e.g. Multiplexed transmission) 11 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
12
© Identifying frames Counting bytes (A basic data unit of 8 bits). This method is used to identify a frame. Byte stuffing – Sending special characters to identify the beginning or the end of the frame. Bit stuffing – Sending a binary flag in the beginning and the end of the frame. The two methods are used. 12 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
13
© Frames Starting and ending the frame with a special binary code. (Byte/Character stuffing) Starting and ending with a binary flag (bit stuffing). 13 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
14
Character Count 5 1 2 3 4 5 6 7 8 9 8 0 1 2 3 4 5 6 8 7 8 9 0 1 2 3 character count frame 1 5 characters frame 2 5 characters frame 3 8 characters frame 4 8 characters 5 1 2 3 4 7 6 7 8 9 8 0 1 2 3 4 5 6 8 7 8 9 0 1 2 3 frame 2 (wrong) frame 1 5 characters one-bit error Now a character count Even if the bit checksum can identify an error, and the destination knows that the frame is faulty, it cannot say when the next frame starts. ©14 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
15
© Byte Stuffing Also referred as Character Stuffing. ASCII characters are used as delimiters of the frame. E.g. DLE STX and DLE ETX. Problem: What if DLE is part of the data? Solution: The sender adds additional DLE to the data stream before every original DLE. (Stuffing) The receiver removes the DLE before sending the data to the communication layers above. (Destuffing) DLE STX user data DLE ETX beginning of frame end of frame DLE(0x10): Data Link Escape STX(0x02): Start of TeXt ETX(0x03): End of TeXt 15 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
16
© Byte Staffing user data 0x10 DLE stuffed at the sender DLE destuffed at the receiver 16 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
17
© Bit Stuffing Every frame begins and ends in a special pattern called flag byte [01111110]. Problem: The flag pattern may appear in the data stream. Solution: Every time the link layer finds five continuous values 1 in the data stream ([11111]) it will automatically add the value 0 to the outgoing data stream. When the receiver find five values of 1, it will automatically remove the next 0. 01111110 user data 01111110 beginning of frame end of frame flag 17 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
18
© Bit Stuffing 18 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
19
Example: PPP protocol ©19 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
20
©20 Dealing with errors תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
21
© Errors Information may become faulty during the transmission. Example: 1 bit error. Example: a burst of errors. 21 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
22
© Dealing with errors Frames include additional data: Discover errors or validation. Additional data by the sender. Testing by the receiver. Trying to validate data by statistics (Not absolute). 22 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
23
© Error detection EDC - Error Detection and Correction bits. D represent a data protected by error detection and may include a header Error detection is not 100% proof! Why? -The protocol may miss some of the errors, but that rarely happens. -Longer EDC produces better error detection. 23 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
24
© Error detection 1: Parity check Parity bit is a bit used as a check digit where its value signals if the number of bits with the value of 1. Every word is added a bit to create an even number of ‘1’. Two types of parity bits: Even parity bit equals 0 if the number of ‘1’ values is even, and equals 1 for uneven. Odd parity bit equals 0 when the number of ‘1’ vales is odd, and equals 1 for even. Adding a parity bit in a bit stream allows error detection but do not allow correction. 24 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
25
© Parity Checking - בדיקת זוגיות The parity bit is added to each data unit, where the numbe of ‘1’ values is even. (or odd in odd parity bit). 25 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
26
Parity Checking - בדיקת זוגיות One dimensional parity check: Adding one bit to every byte (7 bits) complimenting to an even number of ‘1’ values. © 26 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
27
© 2D parity check 1 0 1 1 0 1 1 1 1 1 0 1 0 1 1 1 0 0 1 1 1 0 1 0 1 1 1 1 0 0 0 0 1 0 0 0 1 0 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 1 0 VRC LRC A two dimensional parity check: done by a longitudinal row check (LRC) and a vertical row: 27 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
28
Checksum Checksum is an error detection code that allow error detection. It is a type of redundancy check. The Checksum adds an additional part to the message which is a result of a known function applied on the message. It is possible to apply the function on the message and validate that the result is identical to the result added to the message. The efficiency of the redundancy check depends on the function chosen. The most simple redundancy function is the identity function. Given a message M the output will be the message itself. Different Checksum methods include: Parity check, Modular sum, CRC. ©28 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
29
Checksum This function allow an efficient error detection. It do not allow error correction because we cannot know if the error was in the message or in the checksum. Another simple function is given a message M the output will be MM and when data is sent using the checksum there are 3 versions and in a case of an error we can compare and fix by majority. Checksum is the redundancy of the sum of all the bytes in the data. Example: assume 4 bytes, 0x25, 0x62, 0x3F,0x52. The sum is 0x118. We remove the carrier bit and get 0x18. Calculating the Two’s complement gives 0xE8. That is the “Modular sum” checksum. ©29 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
30
Calculating One’s complement Calculating One’s complement: Turn “1” to “0” and “0” to “1” 0 1 1 0 1 1 0 0 1 0 0 1 0 0 1 1 Representing negative numbers in a simple way where we can subtract by adding the negative of the number. We would like that the addition would give zero. © תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012) 30
31
31 Calculating two’s complement Calculating Two’s complement 1.Turn “1” to “0” and “0” to “1” 2.Add 1. 0 1 1 0 1 1 0 0 1 0 0 1 0 0 1 1 + 1 1 0 0 1 0 1 0 0 Solution: We calculate one’s complement and add 1. © תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012) 31
32
חיסור בעזרת משלים ל – 1 קלט : X, Y מספרים בעלי " גודל " של n סיביות, מיוצגים ע " י משלים ל – 1 בעזרת n+1 סיביות. חשב : X + Y והשאר התוצאה ב – 1’s comp.. ביצוע : א. חבר X + Y. ב. אם יש נשא סופי חבר אותו אל התוצאה ( נשא מעגלי ) דוגמא ע " י n=3: X0X0 X1X1 X2X2 X3X3 Y0Y0 Y1Y1 Y2Y2 Y3Y3 Z0Z0 Z1Z1 Z2Z2 Z3Z3 c0c0 c1c1 c2c2 c3c3 C נכונות : ע " י חלוקה למקרים בדומה ל – 2’s comp. נשא סופי 2 - 4 -0100 שלילי -0010 = -2 5 - 3 -0011 1 + 0 0 1 00 0 1 0 32 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012) ©
33
חיסור בעזרת המשלים ל- 1: המשלים ל- 1 של 01101 הוא 10010. (יש נשא) דוגמא לתרגיל חיסור : חיסור בעזרת המשלים ל- 1: המשלים ל- 1 של 100000 הוא 011111. אין נשא. שלילת המשלים ל- 1 של התוצאה היא: 000110- דוגמאות לחיסור בעזרת משלים ל–1 33 דוגמא לתרגיל חיסור :
34
חיסור בעזרת משלים ל – 2: קלט : X,Y מספרים בינאריים בעלי n ספרות וספרת סימן (n+1) מיוצגים ע " י 2’s Complement קלט : X,Y חבר : X+Y בדוק גלישה overflow Z=X+Y X n-1 X n-2 …X 1 X 0 Y n-1 Y n-2 …Y 1 Y 0 Z n-1 Z n-2 …Z 0 נשא נשא סופי התעלם מנשא סופי התוצאה הנה חיובית / שלילית בייצוג 2’s Comp.. X n-1 X n-2 …X 0 Y n-1 Y n-2 …Y 0 X n-1 X n-2 …X 0 + Y n-1 Y n-2 …Y 0 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012) 34 ©
35
5 = 0101 2 – 3 = 0 01 1 2 1 1 0 1 2 10 דוגמא : n=3, חשב -5 + (3) 3-5 נזדקק ל - 4 סיביות (+ 1 ) ביט סימן. 1 “1” נשא סופי " התעלם ". 3 = 0011 2 – 5 = 0 1 0 1 2 1 0 1 1 2 11 שלילי -2 2’s Comp. 35 1 0 1 0 2 + 1 1 1 0 0 2 + 1 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012) © :3-5 :5-3
36
© Error detection 2: Modular sum calculation Sender does the following: Data is divided to k parts. Each part is n bits long. Add all parts and use Two’s complement. This is the checksum. The checksum is delivered with the data. 36 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
37
© Modular sum calculation The receiver performs the following: Data unit received is divided to k parts. Each part is n bits long. Add all parts. Add the checksum. If the result is zero the data is accepted. Otherwise it is rejected. 37 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
38
©38 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
39
© Modular sum example Assume a 16 bit block sent and using 8 bit Modular sum checksum. 10101001 00111001 We add the numbers using the Two’s complement. 10101001 00111001 ------------ Sum 11100010 סיכום One’s complement 00011101 המשלים ל -1 Two’s complement 00011110 The sent pattern: 10101001 00111001 00011110 39 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
40
© Modular sum example When the reciever receive the pattern and there are no errors, 10101001 00111001 00011101 When the receiver sums all the three parts he is supposed to get a series of zeros. That means there are no errors in transmission. 10101001 00111001 00011110 Sum00000000 means that the pattern is OK. 40 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
41
© Modular sum example Assuming there is a burst of 5 error bits which affect 4 bits. 10101111 11111001 00011101 When the receiver sums the three parts: 10101111 11111001 00011110 Partial Sum 1 11000110 the pattern is corrupted. 41 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
42
© Modular sum Advantages: Easy to calculate. Small size. Disadvantages: Do not discover all errors Example: 2 nd bit is flipped in every part. 42 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
43
Cyclic redundancy check (CRC) Cyclic redundancy check (CRC) is a error detection code or a hash function used to find errors in data transfer. Before data transfer CRC is calculated and added to the transferred data. After the data transfer the receiver verifies using CRC that the data transmitted with no errors. The CRC is common because of the ease of binary hardware implementation, the ease of mathematic computation and the efficiency in discovering common errors of noisy channels. אופן הפעולה שמסתכלים על כל וקטור באורך n כפולינום שמקדמיו הם קואורדינטות הווקטור. CRC משתמש בפולינום המוגדר בפולינום יוצר מדרגה.r סוגים שונים של קוד CRC משתמשים בפולינומים יוצרים שונים. בהינתן פולינום יוצר מדרגה r ובהינתן הודעה M שברצוננו לקדד, עלינו לבצע את הפעולות הבאות : 1. נוסיף r אפסים מימין להודעה. 2. נחלק בפולינום ( תוך שימוש בחילוק של השדה מודולו 2) 3. נחסר את השארית תוך שימוש ב -xor במקום בחיסור רגיל.xor נצרף את התוצאה שקיבלנו מימין להודעה המקורית ונשלח. כמו בכל קידוד,Checksum הצד המקבל יבצע את שלבים 1 ו -2 ויוודא ש -r הביטים האחרונים שנשלחו זהים לתוצאה שהתקבלה. © 43 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
44
© Cyclic Redundancy Check (CRC) A popular error detection technique. A binary data string length K represents a polynomial of degree K. the K bits are the coefficients for the polynomial G(x) with K powers of x, x k-1 to x 0. 110001 represents the polynomial G(x)=x 5 +x 4 +x 0. Possible generating polynomials: G(x) = x 16 + x 15 + x 2 + 1 CRC-16 ( סיביות בדיקה 16) G(x) = x 16 + x 12 + x 5 + 1 CRC-16 ITU ( סיביות בדיקה 16) G(x) = x 32 +x 26 +x 23 +x 22 +x 16 +x 12 +x 11 +x 10 +x 8 +x 7 +x 5 +x 4 +x 2 +x+1 CRC-32 ( סיביות בדיקה 32 ) This allows detection of one bit error, two bit error, up to 16 bit errors. 99.997% probability of detection 17 bit errors, 99.998 probability of detecting 18 bit errors and above. 44 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
45
Cyclic Redundancy Check (CRC) Every binary vector with n elements may represent a polynomial where the elements are the coefficients. CRC uses a r ranked generating polynomial. Different CRC methodes use different generating polynomials. Given a polynomial ranked r and a message M: 1. Add r zeros to the end of the message. 2. Divide by the polynomial. 3. Subtract the residue using XOR. Add the result to the original message תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012) ©45
46
Sender has d data bits => D, as a binary number. Sender and receiver choose an r+1 generating pattern => G. Choose r bits => R, such that: is divided by G Receiver knows G, devides by G. If the result is not zero: Error detected. Used in ATM, HDCL. טבלת XOR: CRC Algorithm © 46 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
47
© CRC Example D=101110, d=6, G=1001, r=3 => = 101110000 Want: D. 2 r XOR R = nG equivalently: D. 2 r = nG XOR R equivalently: if we divide D. 2 r by G, want reminder R R = remainder[ ] D.2rGD.2rG 47 בחילוק עושים XOR בין הביטים תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
48
© 48 Multiple Access Protocols תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
49
© 3 types: Channel Partitioning The channel is divided to timeslots. Allocating timeslots to an edge for an exclusive use. Random Access Allow collision. Recovery after collision. Taking turns Monitoring the channel tightly to avoid collisions. Advantages: Efficiency, equality, simplicity, Distribution. MAC (Multiple Access Control) 49 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
50
© TDMA: time division multiple access Access to the channel is given by a queue. Stations get a limited time to transmit when it gets the entire bandwidth. The stations broadcast one after another. Time slots lengths are constant. Each cycle all stations broadcast one time slot. Unused timeslots are wasted. Example: LAN with 6 stations. Stations 1,3,4 broadcast while the timeslots of stations 2,5,6 are unused. TDMA MAC Protocol 50 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
51
© FDMA: frequency division multiple access The entire bandwidth is divided to equal frequency sub channels. Between two sub channels a safety distance is defined – unused bandwidth. Every channel get a sub channel with a constant frequency range. Unused broadcast time is lost. Example: LAN with 6 stations. Stations 1,3,4 broadcast while the frequencies of stations 2,5,6 are unused. frequency bands time FDMA MAC Protocol 51 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
52
© CDMA(Code Division Multiple Access) In CDMA broadcasts from all stations are divided over the time-frequency by coding. CDMA is based on Spectrum Spread, that is distributing the original data over a bigger bandwidth. The source uses a chipping sequence to code the data over the entire bandwidth. The receivers use their own chipping sequence to decode and transmit the data to the target. Mainly used in satellite and cellular communication. Encoded signal = Original data X Chipping sequence. Decoding = Encoded signal X Chipping sequence. 52 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
53
© CDMA Encode/Decode 53 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
54
© CDMA: two-sender interference 54 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
55
© Random Access protocols When an edge has a packet to be sent The station will send the package over the entire bandwidth of the channel. Rate R. No priority for one station over the other. Two or more stations broadcast together => Collision. MAC random access protocols detail: How to discover a collision How to recover from a collision (e.g. delay and retransmission). MAC protocols ALOHA ALOHA slotted CSMA and CSMA/CD 55 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
56
ALOHA protocol Background – during the 70s the Hawaii university were developing a protocol for channel access. Two main versions for the protocol: Pure Aloha and Slotted Aloha. The difference between them is in the time division. The Pure Aloha protocol do not use discrete timeslots while the Slotted Aloha uses them. Pure Aloha – The basic idea is simple, users transmit when they have something to transmit. When a collision occurs framed are destroyed. The broadcasting station identifies collisions by listening to the channel. In case of a collision a random delay is in order, followed by retransmission. If the time is not random than a collision will happen again. Systems with shared channels in this fashion are called Contention systems. Aloha transmission scheme: Users transmit frames in a predefined length. When two frames are in the channel at the same time there is a collision and both frames are lost. Notice that even if only the first bit of the new frame collides with the last bit of the frame, the two frames are lost and will be retransmitted. ©56 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
57
© Pure ALOHA Pure Aloha: Simpler and uses no synchronization. A frame is sent: Sent with no wait to the time slot. Collisions will grow: A frame sent at time t 0 will collide other frames sent between times [t 0 -1, t 0 +1] 57 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
58
Pure ALOHA Efficiency The analysis of the efficiency of a channel using this protocol. What it the percentage of frames that will arrive to the destination with no collisions. Frame time – the time needed to transmit a frame. S - The average frame creation frequency. The transmission rate, is assumed to have Poison distribution. If S>1 the rate is higher then the channel transmission rate. In this case almost every frame would suffer from collisions. We must define 0<S<1 to have a reasonable transmission. G – Broadcast attempt rate. Assumed to have Poison distribution as well. Of course, S<=G since there are more broadcast attempts than actual data transfers. When the rate is low G~S and when the rate is high S~P 0 G. P 0 – The probability of having a successful transmission. We assume that the next frame will not be created until the current frame is transmitted. תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012) ©58
59
Pure ALOHA Efficiency t – Time needed to send a frame. t 0 – The transmission start time. If a user sends another frame between t 0 to t 0 +t, it will collide with the grey frame. Also, any frame starting between t 0 +t to t 0 +2t would collide with the frame. תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012) ©59
60
©60 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
61
Pure ALOHA Efficiency The quiet interval is 2t. The time delay needed in order to avoid a collision. The probability of creating K frames in one time frame is given by the Poison distribution: The probability of having no frames is: During 2t interval the broadcast attempts are 2G and the probability of no frames is: The rate of frame creation is: We can see that the maximum throughput is when G=0.5, and: The maximum throughput is very low. We can try to optimize by manipulating G but if we enlarge the broadcast frequency too much the probability of no collisions is lower. Tradeoff! תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012) ©61
62
Throughput vs. offered traffic ©62 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
63
Slotted Aloha In 1972 the Slotted Aloha method was published, aimed to double the throughput. The method suggested divide the time to intervals where one frame would fit a time slot. This attitude needs a synchronization between the users. May be done by beeping by one of the stations. Method: Time is divided to slots which fit a frame. The edge waits with a frame and will transmit at the next slot time. If a collision is detected: Retransmit at the next time slot with the probability P. Repeat until successful transmission. Success (S), Collision (C), Empty (E) slots 63 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012) ©
64
Slotted Aloha Efficiency בשיטה זו, התחנה אינה רשאית לשלוח מידע כל הזמן. התחנה נאלצת לחכות לתחילת מקטע הזמן הבא. אינטרוול השקט קטן פי 2 והוא כעת t בלבד. ההסתברות לחוסר התנגשות כעת היא ולכן -. כפי שניתן לראות, Slotted Aloha מגיע לשיא כאשר, בתפוקה מקסימאלית של, פעמיים מהתפוקה המקסימאלית של pure Aloha. במקרה האופטימאלי נוכל להגיע בפרוטוקול זה להסתברות של 37% למקטעים ריקים ( אי - שידור ), הסתברות של 37% הצלחות. עבודה ב - G גבוה יותר תקטין את מספר המקטעים הריקים, אך תגדיל את מספר ההתנגשויות. הסתברות לכך ששידור ידרוש ניסיונות ( כלומר, התנגשויות, הצלחה אחת ): מספר ניסיונות ממוצע לשידור ( תוחלת ): מספר השידורים הממוצע תלוי בצורה מעריכית ב - G, ולכן עלייה קטנה בעומס, תגרום עלייה אקספוננציאלית במספר ניסיונות השידור ובכך תוריד את הביצועים בצורה חדה. © חוסר התנגשות פעם אחתהתנגשות פעמים 64 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
65
Slotted Aloha Efficiency This method to not allow starting of transmission at any given time. The station has to wait to the next interval. The quiet interval is now halved to only t. The probability of no collision is now: Resulting: As shown slotted aloha has its maximum efficiency when G=1 and is equal: That is twice the throughput of Pure Aloha. Using the optimal case we may get a probability of 37% of empty slots and 37% of successful transmission. The probability that a transmission will take K transmission attempts, that is k-1 attempts and one success is: The mean transmission attempts (Average): Average transmission attempts depends exponentially on G © 65
66
Carrier Sense multiple Access – CSMA Slotted Aloha allows a maximal throughput of 1/e. This is very low since there is no ability to identify if the channel is free or occupied. In many Local Area Networks the stations can identify what the other stations are doing and change their behavior accordingly. These networks may perform much better than Slotted Aloha. Protocols that listen to the broadcast and change behavior are called Carrier sense protocols. ©66 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
67
Carrier Sense multiple Access – CSMA Persistent and Non-persistent CSMA 1 Persistent CSMA When a station has some data to transmit, it first listens to the channel and checks if someone else is already transmitting. When a station recognizes that the channel is free it transmits a frame. If there is a collision the station waits a random time and starts again. This protocol is called 1 Persistent since the station is transmitting in probability 1 in case that the channel is free. Propagating time has a major effect on the performance of this protocol. There is a chance that another station started sending a packet, both stations check the channel. If their signals didn’t reach the other station, the other station will sense a free channel and start to transmit as well. Collision will occure. If the propagating time is zero, there are still going to be collisions because if two stations would like to transmit at the same time as a third station they both are going to wait until the end of transmission to start their own transmission at the same time. Still, this protocol shows a significant improvement from Pure Aloha since the stations wait until the end of the third transmission. Intuitively there is an improvement from both Aloha protocols. תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012) ©67
68
CSMA p persistent CSMA This protocol is used in slotted channels. When a station is ready to transmit it checks the channel, if it is free it will transmit in probability p, or wait until the next segment in probability q=1-p. If the station waits it will go over the protocol again and transmit in probability p or wait in probability q and so on... This happens until a frame is transmitted or until another station started to transmit. The graph shows the throughput as a function of transmission attempts. The delays are not referred. For a very high transmission rate queues start to build and the buffer needs to grow. Transmission that was once bursting is turning into a constant data flow, and we can switch to TDM system. There is a transmission at every timeslot and the throughput is 100% when we disregard the delay. 68 ©
69
CSMA/CD - CSMA with Collision Detection Another performance increase will be achieved when the stations will stop their transmission in case of a collision detection. If two stations sense a free channel and start to transmit at the same time, they both will detect the collision almost immediately. The stations will stop their transmission immediately in stead of finishing the transmission of the frames. A fast transmission stop saves time and bandwidth. CSMA/CD is used on LAN networks over the MAC layer. CSMA/CD uses the following model: At a certain time a station stopped transmitting. Any station may transmit now. If two or more stations decide to transmit together there is going to be a collision, a station may identify a collision by watching the power or the width of the transmitter pulses. When a station identifies a collision, transmission is stopped, a random time is waited, and retransmission will be attempted. That is why the CSMA/CD model alternates between contention slots and data frames. Quiet times appear where no station is transmitting. 69 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012) ©
70
© CSMA/CD CSMA/CD: Collisions are detected shortly after they occur. A collided transmission is stopped, and lowers transmission loss. Retransmission may be forced. Collision detection: Easy with cabled LAN: Measuring signal channel, comparing transmitted signal to the received signal. Difficult in wireless: Since the receivers may miss the collision. In practice the network has a “jamming time” to make sure everyone received the collision signal. 70 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
71
“ Taking Turns ” MAC protocols © Polling: The master is inviting the slaves to transmit according to a queue. Typically silent devices are used. Issues: Overhead- wasted time Reaction time- the time between the invitation and the beginning of the transmission. One failure vulnerability- The master may have problems. master slaves poll data 71 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
72
“ Taking Turns ” MAC © Token passing: Controlled token pass between one edge to another. Token message. Issues: -Token overhead – wasted time -Reaction time- Between receiving the token and transmitting the data. -One failure vulnerability – Token issues. T data (nothing to send) T 72 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
73
© MAC protocols overview How to use shared media? Channel divided by time, frequency, or code. Random, dynamic division. ALOHA, S-ALOHA, CSMA, CSMA/CD Carrier sensing easy to implement over wired technology, difficult over wireless. CSMA/CD is used over Ethernet. Taking Turns Choosing the transmitting edge by a central processor or a token. Bluetooth, FDDI (Fiber Distributed Data Inteface), IBM Token ring. 73 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
74
© MAC protocols overview Channel partitioning MAC protocols High efficiency in high loads Not efficient on low loads: Access delay, 1/N bandwidth is assigned even if only one computer is active. Random access MAC protocols Efficient in low load: One edge can utilize the entire channel. Not efficient on high load, multiple collisions. T aking turns Most efficient for high or low load. Sensitive failure points. 74 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
75
©75 LAN Technologies תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
76
© LAN technologies Until now we covered Data Link layer issues : Services, error detection/correction, multiple access. Next: LAN technologies Addressing – accessing network resources. Ethernet – LAN protocol. Network devices that find the route of datapackets to their destination: Hubs, bridges, switches. IEEE - 802.XX netork standards. Among them is 802.11. PPP – point to point protocol ATM – High throughput protocol. 76 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
77
© LAN מיעון ב- כתובות IP 32-bit: כתובות שכבת הרשת (network-layer address). משמש לקבלת נתונים ( חבילה ) הכולל מידע ומועבר ברשת עם כתובות מקור ויעד. דוגמא : 192.168.32.201 כתובות LAN ( או MAC או physical) MAC = Media Access Control או בקרת גישה למדיה, מזהה ייחודי המוטבע על כל רכיב תקשורת לרשתות מחשבים בעת הייצור. משמש לקבלת נתונים ממשק פיסי אחד לממשק פיסי שני באותה רשת. כתובות MAC עם 48 bit עבור רוב ה - LANs הצרובות בזכרון כרטיס התקשורת. דוגמא : 00:1D:0F:E5:A9:5A 77 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
78
© LAN מיעון ב- לכל כרטיס תקשורת יש כתובת LAN יחודית הצרובה עליו. 78 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
79
©5-79 MAC Addresses and ARP 32-bit IP address: network-layer address used to get datagram to destination IP subnet MAC (or LAN or physical or Ethernet) address: function: get frame from one interface to another physically-connected interface (same network) 48 bit MAC address (for most LANs) burned in NIC ROM, also sometimes software settable תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
80
©5-80 LAN Addresses and ARP Each adapter on LAN has unique LAN address Broadcast address = FF-FF-FF-FF-FF-FF = adapter 1A-2F-BB-76-09-AD 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 71-65-F7-2B-08-53 LAN (wired or wireless) תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
81
©5-81 LAN Address (more) MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure uniqueness) analogy: (a) MAC address: like Social Security Number (b) IP address: like postal address MAC flat address ➜ portability can move LAN card from one LAN to another IP hierarchical address NOT portable address depends on IP subnet to which node is attached תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
82
©5-82 ARP: Address Resolution Protocol Each IP node (host, router) on LAN has ARP table ARP table: IP/MAC address mappings for some LAN nodes TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min) Question: how to determine MAC address of B knowing B’s IP address? 1A-2F-BB-76-09-AD 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 71-65-F7-2B-08-53 LAN 137.196.7.23 137.196.7.78 137.196.7.14 137.196.7.88 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
83
©5-83 ARP protocol: Same LAN (network) A wants to send datagram to B, and B’s MAC address not in A’s ARP table. A broadcasts ARP query packet, containing B's IP address dest MAC address = FF-FF-FF-FF-FF-FF all machines on LAN receive ARP query B receives ARP packet, replies to A with its (B's) MAC address frame sent to A’s MAC address (unicast) A caches (saves) IP-to- MAC address pair in its ARP table until information becomes old (times out) soft state: information that times out (goes away) unless refreshed ARP is “plug-and- play”: nodes create their ARP tables without intervention from net administrator תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
84
©5-84 DHCP: Dynamic Host Configuration Protocol Goal: allow host to dynamically obtain its IP address from network server when joining network support for mobile users joining network host holds address only while connected and “on” (allowing address reuse) renew address already in use DHCP overview: 1. host broadcasts “DHCP discover” msg 2. DHCP server responds with “DHCP offer” msg 3. host requests IP address: “DHCP request” msg 4. DHCP server sends address: “DHCP ack” msg תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
85
©5-85 DHCP client-server scenario 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 A B E DHCP server arriving DHCP client needs address in this (223.1.2/24) network תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
86
©5-86 DHCP client-server scenario DHCP server: 223.1.2.5 arriving client time DHCP discover src : 0.0.0.0, 68 dest.: 255.255.255.255,67 yiaddr: 0.0.0.0 transaction ID: 654 DHCP offer src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 654 Lifetime: 3600 secs DHCP request src: 0.0.0.0, 68 dest:: 255.255.255.255, 67 yiaddrr: 223.1.2.4 transaction ID: 655 Lifetime: 3600 secs DHCP ACK src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 655 Lifetime: 3600 secs תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
87
©5-87 Addressing: routing to another LAN R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4B CC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 A 74-29-9C-E8-FF-55 222.222.222.221 88-B2-2F-54-1A-0F B 222.222.222.222 49-BD-D2-C7-56-2A walkthrough: send datagram from A to B via R assume A knows B’s IP address two ARP tables in router R, one for each IP network (LAN) תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
88
©5-88 A creates IP datagram with source A, destination B A uses ARP to get R’s MAC address for 111.111.111.110 A creates link-layer frame with R's MAC address as dest, frame contains A-to-B IP datagram A’s NIC sends frame R’s NIC receives frame R removes IP datagram from Ethernet frame, sees its destined to B R uses ARP to get B’s MAC address R creates frame containing A-to-B IP datagram sends to B R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4B CC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 A 74-29-9C-E8-FF-55 222.222.222.221 88-B2-2F-54-1A-0F B 222.222.222.222 49-BD-D2-C7-56-2A This is a really important example – make sure you understand! תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
89
© LAN מיעון ב- כתובות MAC מוקצות ע " י IEEE. היצרנים קונים " מנות " של מרחב כתובות MAC ( על מנת להבטיח יחודיות ). אנלוגיה : (a) כתובת MAC: כמו מספר מספר מספר זהות, ביטוח לאומי. (b) כתובת IP: כמו כתובת דואר. כתובת MAC ניידת בעבר ניתן היה להעביר כרטיס תקשורת ממחשב אחד למשנהו ( היום הוא חלק מלוח האם ולכן זו הערה שהיתה נכונה בעבר ). הירארכית כתובות ה -IP אינה ניידת תלויה ברשת אליה המחשב מחובר. פרוטוקול ARP מתרגם את כתובות IP לכתובות MAC. 89 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
90
© LAN is a dominant technology: Inexpensive – about 20$ for a 100Mbps device. Common over the LAN. Less expensive and simpler than token technologies and ATM. Bitrates: 10, 100, 1000 Mbps Metcalfe’s Etheret sketch Ethernet 90 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
91
© The framing includes the following: Framing, the ability to identify the beginning and the end of a message. Addressing: Fields that include source and destination addresses. Error detection: Redundancy codes designed to find transmission errors. Preamble - Sets of bits101010 used to declare the frame existance. Ethernet frames 91 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
92
© Ethernet frames Addressing: 6 Bytes, accepted by all the LAN devices, unused if the address do not match. Type: Defines the data type that is going to be on the data field. Allows us to work with several higher protocols, IP, DECNET, or IPX. Data: The size of the data field is between 46 to 1500. CRC: The receiver check for errors. If there are errors the frame is not used. 92 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
93
Ethernet implementation The Ethernet is based on CSMA/CD - Carrier Sense Multiple Access/Collision Detection. Network access in 4 steps: 1. Sensing – The station checks if there is a carrier, that is if someone is transmitting. 2. The station waits 9.6 microseconds, and if there is no broadcast at the time the station is transmitting but keeps monitoring. 3. The frame transmitted is distributed all over the network. It is possible that another station have been waiting and starts to transmit. In this case both stations detect collision and stops the transmission. 4. Both stations would try to transmit again later. The probability that they would try to transmit at the same time again is lowered by using a special algorithm, BACK OFF algorithm, implemented over the NIC. ©93 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
94
© CSMA/CD Algorithm A: sense channel, if idle then { transmit and monitor the channel; If detect another transmission then { abort and send jam signal; update # collisions; delay as required by exponential backoff algorithm; goto A } else {done with the frame; set collisions to zero} } else {wait until ongoing transmission is over and goto A} 94 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
95
© Ethernet ’ s CSMA/CD Jam Signal: Make sure that all others are aware of the collision. 48 bits Exponential Backoff: Make sure that the transmission is getting adjusted to the current load. Heavy load: longer wait. First collision: choose K out of {0,1}; the delay is K X send time of 512 bits. (on a 10 Mbps it is 51.2 microseconds) N-th collision choose K out of {0,1, …, 2 n -1}. After 10 collisions or more choose K out of {0,1,2,3,4, …,1023}. 95 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
96
© Ethernet: 10Base2 10:10Mbps 2: Maximum cable length 200m. Thin coaxial cable in bus technology. Amplifiers are used to connect many segments. 96 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
97
Ethernet 10BaseT and 100BaseT Frequency of 10/100 Mbps is called fast Ethernet. T: Twisted Pair. Uses Hub to connect computers with twisted pairs, that’s why this technology is called Star topology. CSMA/CD is applied by the hub. Maximum distance between the computer and the hub is 100m. Hub may disconnect noisy adapters. Hub may statistically monitor the throughput for the Admin. twisted pair hub
98
© Ethernet 1Gbit Uses the standard Ethernet frame. Allows point to point and broadcast to all the LAN. Uses CSMA/CD with short distances for high efficiency. Buffered Distributors in stead of hubs. Full Duplex needed for 1Gbps point to point. Half duplex – data can flow only in one direction at a certain time. Full duplex – data may flow both directions at the same time. 98 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
99
Token Ring Since CSMA is based on contention, it may not be efficient. Token Ring systems use a different approach. Network access is given to the station that holds the token. Than the token is passed to other stations until reaching a station waiting to submit a message. Two topologies: Token passing rings and token passing busses. Token passing ring the ring topology defines the logical topology- the order of message passing. The token passing bus is more flexible, the order of message passing is determined by tables stored at each station. If there is a station that do not initiate messages (such as a printer), it may only end the cycle, and will not be included in the tables. If one station needs high priority it may appear several times in the tables. ©99 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
100
Token passing rings and token passing busses Token passing busses: Stations are physically connected on a bus but organized as a ring by the software. Token passing rings: The ring topology defines the logical topology, the order of message passing. תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
101
© LAN extension Motivation: Distance limitation. Lower performance with more users. Devices: Hub Repeater Bridge Switch 101 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
102
© Hub - מרכזיה HUB Hardware Creates one LAN segment The Hub is a central point to the entire network. A differen cable connect each computer to the Hub. 102 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012) Each Ethernet frame is sent from one port to all the other ports. Logically distributes the signals. Every signal goes to all the ports. Single collision segment
103
Repeaters מגבר משחזר - Repeater – connects two segments of the same network and allows extension of the distance between the two ends of the network. The repeater is acting when a transmission is received in one of its ends, cleans the signals, amplifies the signal and transmits it on the other side. A repeater do not confine the broadcast segments or collision segments. Each communication media uses its own repeater. different devices exist for different media, for example, fiber optics and wireless. It is possible to extend the network with a repeater and renew weak signals. Hardware. Connects two LAN segments. Copies a signal from one segment to another. Amplifies the signal. Adds noise and collisions. Full duplex - Works on both ways at the same time. R Repeater Direct connection Ethernet segment תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
104
Bridges Bridge connects two LAN networks Bridge, as opposed to a HUB, differentiate the collision segments of each sub network. It learns the network and knows how to route packets to the right port according to the MAC address and a bridging table. The bridge learns the topology dynamically and the bridge is transparent to all the clients. When a packet is received the bridge keeps the source address and the port received if not already exists and the current time. If the destination address does not exist in the table, the bridge will send a copy of the packet to all other ports according to CSMA/CD. If the address exists, packets will be directed to the port. The bridge will delete records when their aging time is high over a predefined time. 104 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012) ©
105
© Bridges Link layer hardware. Connects two LAN segments. Frame delivery Stores and sends Ethernet frames. Examines the frame header and selectively sends the frame according to the destination’s MAC. When the frame is sent to the LAN segment, CSMA/CD is used in order to access the segment. Do not extend noise or collisions. Learns the addresses and filters. Transparent Computers are not aware of the bridge existance. Plug-and-play, Self-learning. Bridge does not need to be configured. 105 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
106
© Bridges differentiate the load Bridge breaks the local network to smaller segments. The bridge filters packets: Frames of the same segments are not sent to other segments. The small LAN segments are different collision segments. bridge collision domain collision domain = hub = host LAN segment 106 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
107
© Bridge learning algorithm Listens in mixed mode, all frames are copied and analyzed. Looks at the source addresses of incoming frames. Prepares a list of the computers on each segment. Retransmits only if needed. Always retransmits on broadcast/multicast. 107 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
108
© Bridge learning algorithm A bridge has a bridge table. Writing to the bridge table: LAN addresses of the edges, the ports and the current time. Old records are deleted (60 min. lifetime). The bridge learns which computers could be accessed through each port. When a frame is received, the bridge learns the sender’s position, LAN segment. A record of the tuple sender-position on the bridge table. 108 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
109
© Bridge example Assume that C sends a frame to D and D returns another frame to C. The bridge receive a frame from C. C do not appear on the bridging table. Since D do not appear on the bridging table the bridge sends a frame to ports 2 and 3. Frame is received by D 109 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
110
© Bridge example D creates a frame for C and sends it. The bridge receives the frame. Notice that now D is on port 2 in the bridging table. The bridge knows that C is on port 1 and selectively transmits the frame on port 1. 110 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
111
© סינון/משלוח כאשר ה - bridge מקבל מסגרת : אינדקס טבלת ה - bridge משתמש בכתובת ה -MAC של היעד if entry ( כניסה ) found for destination then { if destination on segment from which frame arrived then drop the frame else forward the frame on interface indicated } else flood ( הצף ) forward on all but the interface on which the frame arrived 111 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
112
© Spanning tree algorithm 112 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
113
© אלגוריתם של עץ פורש Spanning Tree Algorithm A bridges network is a graph. Usually the graph is hierarchal. If the bridge is at the end of the hierarchy it fails – LAN could be disconnected. If the same data is duplicated too many times over the LAN – May even cause a network failure. Spanning tree may find a sub graph that spans all the edges with no loop. Spanning – All LAN segments are included. Tree – one topology without loops. Distributed protocol: Determines which bridge is the root. Every bridge directs ports that are not part of the tree to other ports. 113 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
114
© Spanning Tree example B3 B5 B7 B2 B1 B6 B4 The protocol: 1.Choose a root. 2.For each LAN choose the closest bridge to the root. 3.All LAN bridges send packets towards the bridge closest to the root. B8 114 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
115
© Spanning Tree example B3 B5 B7 B2 B1 B6 B4 Root B8 B2B4B5B7 B8 B1 Spanning Tree: 115 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
116
© Switch High performance, doubles the bridge interfaces. Physically similar to HUB. Logically similar to bridge. Works on the packets. Understands addresses. Forwards a message only when needed. Enhanced forwarding algorithms Allows full duplex. 116 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
117
© Typical setup 117 תקשורת מחשבים ואלגוריתמים מבוזרים ( חורף 2011-2012)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.