Download Chap3-DataLinkLayer - Home

Document related concepts

Network tap wikipedia , lookup

Point-to-Point Protocol over Ethernet wikipedia , lookup

Internet protocol suite wikipedia , lookup

Recursive InterNetwork Architecture (RINA) wikipedia , lookup

IEEE 802.1aq wikipedia , lookup

IEEE 802.11 wikipedia , lookup

CAN bus wikipedia , lookup

IEEE 1355 wikipedia , lookup

UniPro protocol stack wikipedia , lookup

Transcript
IS370
Data Communications
and
Computer Networks
Chapter 3 : Data-Link Layer
Instructor : Mr Mourad Benchikh
1
Introduction
• Transform the physical layer to a link responsible for node-to-node
(hop-to-hop) communication.
• Data link layer responsibilities:
– Framing
• Divides the stream of bits received from the network layer into data units called frames.
– Addressing
• Adds a header to the frame to define the sender and receiver addresses of the frame.
– Flow Control
• Imposed when the receiver reception data rate is less than the sender emission data rate.
– Error Control
• Adds reliability to the physical layer.
– Media Access Control
• Determines the device to have control over the link when many devices are connected to
this link.
2
Asynchronous/Synchronous transmission connection
•For receiver to sample incoming bits properly, it must know arrival time
and duration of each bit that it receives
•Two connections types to synchronize between transmitter and receiver
–Asynchronous connection/transmission
–Synchronous connection/transmission
•Asynchronous transmission
–Data transmitted one character at a time
•In idle state, receiver looks for transition 1 to 0 => additional start bit (0).
•Then samples next intervals (dependent on character length chosen)
•Ended by one or more stop bits (1s)
•An optional parity bit can be added to detect errors.
–Then looks for next 1 to 0 for next char
•A gap of varying duration (represented by an idle channel (or stop bits)) between character transmissions.
–No need to have transmitter and receiver clocks synchronized
•Receiver resynchronize at the start of each character received with the start-bit.
•Receiver clock is N times the transmitted rate (N=16 commonly).
•Sample the start-bit after N/2 clock cycles and the subsequent bits after each N cycles(=>center of the bit)
•Receiver operate with the same number of bits per character and number of stop bits as the transmitter
–Mainly used by slow speed devices (I.e. data with large gaps) such as keyboard.
–Overhead of 2 or 3 bits per character
3
Asynchronous/Synchronous transmission connection
•Synchronous connection
•Block of data (I.e. frames) transmitted without start/stop bits or
gaps
–Frames could be constituted of multiple characters.
•Need to indicate start and end of block => use flags (preamble,
post-amble)
–A start sequence called a header is placed before each block of characters and
–A stop sequence called a tail is inserted at the end.
•Transmitter and receiver clocks must be synchronized
–Can use separate clock line
–Embed clock signal in data
Digital signals : encoded with Manchester encoding
Analog signals : using phase shifting Carrier frequency (analog)??
Achieves higher speeds and greater efficiency than asynchronous transmission
 Large systems and networks commonly use synchronous transmission
4
Asynchronous/Synchronous connection
5
Error
Detection
and
Correction
• Data can be corrupted during transmission
– Unpredictable interference from heat, magnetism, etc., can change the shape and the timing
of the signal
• => with binary data : 0 changed to 1 or vice-versa.
• Two types of bit-error
– Single-bit error
• Only one bit in the data unit (such as character, frame) has changed.
– Burst error
• Means that two or more bits in the data unit have changed.
• Length of the burst is measured from the first corrupted bit to the last corrupted one
• Not every bit will necessary be corrupted.
• Redundancy
– To be able to detect or correct errors, extra (redundant) bits should be sent with the data.
• Error Detection vs. Correction
– Detection : check only if an error has occurred. The number of errors is without importance.
– Correction: need to know the exact number of corrupted bits and their locations.
• Error Correction techniques: Forward Error Correction (FEC) vs. Retransmission
– Retransmission: when the receiver detects error(s), it asks the sender to retransmit the message.
– FEC: The receiver tries to both detect and correct, by itself, an erroneous received message. Only
possible if the number of errors is small.
6
Error
detection
• Need a means to detect if an error has occurred during transmission.
• Error detection uses the concept of redundancy
– Means adding extra bits for detecting errors at the destination.
• The data, of m bits, to be sent is called the dataword.
• The r redundant bits are calculated and then added to the dataword.
• The result is a codeword with n = m + r bits
• Four types of redundancy checks are used in data communication
– Simple parity-check code
– Two-dimensional parity check code.
– Cyclical redundancy check (CRC).
– Checksum
• Simple parity check
–Most common and least expensive mechanism for error detection.
– A parity bit is added to every dataword so that the total number of 1s becomes even => evenparity
• n=m+1
• Odd-parity is an another alternative.
7
Error detection: Simple parity check code
•
•
• Example
– Suppose the sender wants to send the word world. In ASCII the five characters are coded as
1110111 1101111 1110010 1101100 1100100
The following shows the actual bits sent
11101110 11011110 11100100 11011000 11001001
– Now suppose the word world in Example 1 is received by the receiver without being corrupted in transmission.
11101110 11011110 11100100 11011000 11001001
The receiver counts the 1s in each character and comes up with even numbers (6, 6, 4, 4, 4).
The data are accepted.
– Now suppose the word world in Example 1 is corrupted during transmission.
11111110 11011110 11101100 11011000 11001001
The receiver counts the 1s in each character and comes up with even and odd
numbers (7, 6, 5, 4, 4). The receiver
knows that the data are corrupted, discards
them, and asks for
retransmission.
• Simple parity check can detect all single-bit errors. It can detect burst errors only if the total
number of errors in each data unit is odd.
– It cannot detect errors where the total number of bits damaged is even.
• Sent data unit (1000111011) ; received data unit (1110111011)
8
Error detection: Two-dimensional parity check code
• The dataword is organized in a table.
• For each row and column, 1 parity-check bit is calculated.
• The whole table is sent to the receiver.
• This technique can detect up to three errors anywhere in the table.
– Arrows point to the location of the error(s) ??.
• Errors affecting 4 bits may not be detected.
9
Error detection: CRC
• Based on binary division
• CRC added to the data unit so that the resulting data becomes
exactly divisible by a predetermined number
• CRC
– Exactly 1 less bit than the divisor
•The divisor is predefined and agreed on
1. A string of n zeros added to the data unit (divisor n+1 bits).
2. New data divided by divisor where the remainder is the CRC.
3. Replace 0’s by CRC
10
Error detection: CRC
• CRC generator (at the transmitter)
• Data to be transmitted : 100100 => dividend
• Divisor : 1101
• Data will be transmitted as
100100001
11
Error detection: CRC
• CRC checker (at the receiver)
– Received data : 100100001
– Remainder is all zero => assume no errors
– No zero remainder => indicates errors
12
• Divisor
Error detection: CRC
– Usually represented as an algebraic polynomial not as a string of 1s and 0s.
Name
Polynomial
Application
CRC-8
x8 + x 2 + x + 1
ATM header
CRC-10
x10 + x9 + x5 + x4 + x 2 + 1
ATM AAL
ITU-16
x16 + x12 + x5 + 1
HDLC
ITU-32
x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4
+ x2 + x + 1
LANs
• CRC can detect (??)
1. All burst errors that affect odd number of bits
2. All burst errors of length  degree of polynomial
3. With high probability burst errors > degree of polynomial
13
Error detection: Checksum
• Used in the Internet by several protocols although not used at the data link layer.
– CRC is also used in other layers than the data link layer
• Checksum at the sender side
– A list of number is to be sent.
– The checksum is calculated as the negative (i.e. complement) sum of these numbers.
• Initially, the checksum is set to 0.
– The list of number (including the checksum) is then transmitted.
• Checksum at the receiver side
– The receiver computes the negative sum of all the numbers including the checksum.
– If the sum = 0 => it assumes no errors, otherwise the data is discarded.
• One’s complement arithmetic
– Allows the checksum to be expressed as an x-bit word if all the numbers can be written as an
x-bit word.
– If the checksum has more than x bits, the extra leftmost bits are added to the x rightmost bits
(wrapping).
– A negative value can be represented by inverting all bits.
• This is the same as subtracting the number from 2x-1.
• Example
– Represent the number 21 in one’s complement arithmetic using only four bits?
• 2110 = 101012 which is in 5 bits.
• Wrap the leftmost bit an add it to the four rightmost bits : (0101 + 1) = 0110 or 6.
14
Error detection: Checksum
• Example (cont’d)
– How to represent the number (-6) in one’s complement arithmetic using only four
bits?
• The negative or complement is found by inverting all the bits: +6 is 0110 => -6 is 1001
(which is 9 if we consider unsigned numbers)
• Another way : (24-1) - 6 = 15 - 6 = 9
– Suppose a list of five 4-bit numbers, (7, 11, 12, 0, 6), is to be sent to a destination.
Describe the checksum procedure at both the sender and the receiver sites.
•
15
Error detection: Checksum
• Internet checksum
– Sender site:
1. The message is divided into 16-bit words.
2. The value of the checksum word is set to 0.
3. All words including the checksum are added using one’s complement addition.
4. The sum is complemented and becomes the checksum.
5. The checksum is sent with the data.
– Receiver site:
1. The message (including checksum) is divided into 16-bit words.
2. All words are added using one’s complement addition.
3. The sum is complemented and becomes the new checksum.
4. If the value of checksum is 0, the message is accepted; otherwise, it is rejected.
• Performance
– Easy to calculate and can be computed in hardware
–Not strong as CRC
• The error detection is not possible if one word value is incremented and another word
value is decremented by the same amount.
– The tendency with Internet new protocols is to replace the checksum with CRC.
16
Error Correction
 Single-bit error correction
 Must know the location of the invalid bit
 Example: to correct a single-bit error in an ASCII character, the error correction code must
determine which of the seven bits has changed.
 => should distinguish between 8 states: no error, error in position 1, error in position 2, …, error in
position 7.
 3 redundancy bits are adequate?.
 No, what about errors in the redundancy bits themselves?
 In general
 Data bits (m), redundancy bits (r) => m+r bits to be transmitted..
 r should be able to indicate m+r+1 different state (no error, 1 error, etc).
 => 2 r  m  r  1
 Example
 If the value of m=7 (as with ASCII-code), the smallest value that satisfies the equation
7+4+1
r = 4 : 24 ≥
 Hamming code: how to position the redundancy bits?
 For an ASCII character, redundancy bits are placed at positions which are power of 2 of the 11-bit
sequence.
 Each r bit (redundant bit) is the parity-check bit for one combination of data bits
 Each data bit may be included in more than one parity check calculation
17
Error
Correction:
Hamming
code
 Single-bit error correction
 Hamming code (cont’d)
 Example
18
Error
Correction:
Hamming
code
• Hamming code (cont’d)
– Suppose that the bit number 7 has been corrupted during transmission
– The receiver recalculate four new VRCs using the same set of bits and the parity
bits.
– The new parity values (r8, r4, r2, r1) indicates the location of the bit error in case a
single-bit error has occurred
– The receiver reverse then the incorrect bit.
–If the new parity values=0 => no error has occurred.
• Hamming code to allow burst error correction needs more redundancy
bits
19
Data Link Control
• A main function of the data link layer that deals with node-to-node communication.
• Data link control consists of
– 1) Framing, 2) Flow and Error Control, and 3) Software implemented protocols.
• Framing
– The data link layer needs to encapsulate the network layer packets into frames so that each
frame could be distinguished from another.
– Typical frame contents
• Header
– Start delimiter (or a flag)
– Source/Destination address
– Type of frame
– Other control information
• Payload
– Packet from layer above
• Trailer (optional)
– Error detection or error correction redundant bits.
– Other control information
– End delimiter (or a flag)
– The frame structure is specified by the data link layer protocol.
20
Data Link Control : Framing
• Problem: How to interpret a continuous stream of bits, received by the
physical layer, as a series of frames by the data link layer?
– => How to know frame boundaries?
• From:
• To:
• Fixed-size vs. variable-size framing
– Frame size can be fixed or variable.
– There is no problem with fixed-size framing because the frame boundaries are
known.
• The WAN ATM uses the fixed-size framing.
• Variable-size framing is prevalent with LANs
• Variable-size framing techniques/approaches
– Physical layer coding violations
– Byte count
– Character-oriented
– Bit-oriented
21
Data Link Control : Framing
• Physical layer coding violations
– Invalid physical signals to start or end
• Ex: differential Manchester encoding
– HH and LL can be used as starting and ending delimiters
• Used in token ring (IEEE 802.5)
• Ex: with analog signal
– Invalid analog signal can be used
• Used in token bus (IEEE 802.4)
• Byte counting
• Frame length found in frame header.
• Data Link Layer uses the first header count to count the number of characters in the frame
• No need for encoding delimiter.
• Used with another method to mark start of frame.
• Specified in IEEE 802.3 Ethernet standard but not used too much.
• Problems arise if the header count gets corrupted, then the frames get
mixed up.
22
Data Link Control : Framing
•ASCII
–Most commonly used code for encoding printable and nonprintable (control)
character.
–Uses 7 bits to encode each of the 128 characters.
•EBCDIC (extended binary coded decimal interchange code)
–8 bit code used by IBM equipment
23
Data Link Control : Framing
24
Data Link Control : Framing
• Character-oriented framing
– Control characters (flags) used to delimit frames
• Standard character codes -ASCII and EBCDIC-contain special communication
characters that cannot appear in data.
• Start delimiter : STX
• End delimiter : ETX
• SYN : indicates idle state between frames.
– Examples
• If frame contents including rest of header is [contents]
• It is transmitted <STX>[contents]<ETX><SYN><SYN>
– Problems with binary data
•What if [contents] includes
(possible with binary data) _
– Frame becomes:
•What if [contents] includes
?
– Frame becomes:
25
Data Link Control : Framing
• Character-oriented framing
– Character (or byte) stuffing: allows starting and ending characters
delimiters to appear elsewhere in the frame.
• Use DLE (Data Link Escape) character.
– Start delimiter becomes: <DLE><STX>
– End delimiter becomes:<DLE><ETX>
– Any <DLE> inside the frame is replaced by <DLE><DLE>
– Receiver discards 2nd DLE in pair whenever pair <DLE><DLE> appears.
– Example
• Suppose contents include:
• Transmitter modifies this to:
• Receiver knows that
characters <DLE> and is not the end of the frame.
really contains 2 separate
– The Unicode, which is in use today, conflicts with the 8-bit
characters.
• => The tendency is moving to the bit-oriented framing.
26
Data Link Control : Framing
• Bit-Oriented Framing
– Bit flag used to delimit frame.
– Can be used with frames with all bit lengths
• Not just a multiple of 8
– Character-oriented framing is used only for a specific character set (ex. ASCII)
– Example: standard protocols use
• Delimiter (opening and closing flag) :
(6 ones)
– If frame contents including the rest of header is [contents], it is modified when
transmitted as
– Constant 1’s is considered an idle state.
• Problems with binary data:
– What if [contents] includes
– Frame becomes
– What if it includes
• Frame becomes
27
Data Link Control : Framing
• Bit-Oriented Framing
– Bit-stuffing
• Allows bit sequence which is the delimiter flag to appear elsewhere
in the frame.
– HDLC bit-stuffing
– Never transmits more than 5 ones in a row within the frame
– After every set of 5 ones within a frame, a zero is inserted by sender.
– When receiver gets 0111110, it discards the last zero.
– Exactly 6 one in a row identifies the delimiter.
– More than 6 ones in a row within a frame is an error.
– HDLC example
• Data is
(12 ones in a row, then 5 in a row)
• Transmitter modifies this to :
• And transmits
28
Data link control: Flow & Error Control
• Flow control
– Refers to the set of procedures used to restrict the amount of data that the sender
can send before it must wait for an acknowledgement from the receiver (to avoid
overwhelming).
• The receiver has a limited speed to process incoming data
• It has a limited amount of memory to store the incoming data.
• Error Control
–In the data link layer, it refers to error detection and retransmission.
• ARQ (Automatic Repeat reQuest) : any time an error is detected in an exchange, specified
frames are retransmitted.
Data link control: Protocols
• Data link layer’s protocols, combining framing, flow control, and error control, are written in
software and used to achieve node-to-node communication.
• The protocols to be discussed are unidirectional
• => The data frames travel only in one direction : always from a node (sender) to another node
(receiver).
• In real-life, the protocols are bidirectional.
• Piggyback technique is used to include the nak and ACK frames into data frames
29
Data link control: Protocols
• When data is sent as a sequence of frames, two
types of error can occur:
Lost frame
- The frame fails to arrive at the receiver.
- This may be due to a noise burst destroying the frame beyond
recognition
Damaged frame
- A recognizable frame arrives at the receiver but some bits are in
error
• Common ARQ protocols :
–Idle ARQ: (i.e. stop-and-wait ARQ) used with characteroriented transmission schemes ?.
–Continuous-ARQ: used primarily with bit-oriented
transmission schemes ?.
30
Data link control: Stop-and-Wait ARQ
• The sender sends a frame and stops to wait for a response from the receiver
• Upon receipt of a frame, the receiver checks it for errors.
– If no errors, the receiver sends a special frame called ACK (i.e. a positive acknowledgement).
– Otherwise, the receiver will do nothing.
• The reception of an ACK from the sender indicates that the outstanding frame has
been correctly received and then the next frame will be transmitted
– The sender keeps a copy of the sent frame until it receives its ACK.
•Also, the sender starts a timer (set with a specified time period) every time it
sends a frame.
–If the timer expires before the reception of the ACK, the sender assumes that packet is
corrupted or lost.
• The sender will resend the same packet.
• This is the same scenario if the ACK get lost
• In order for the receiver to discriminate between the next frame (as it expects)
and a resent one (duplicate) , each frame transmitted must contain a unique
identifier, known as the sequence number (N, N+1, etc.), found in the frame
header.
– Receiver discards a duplicate frame but will resend the previous ACK (to reconfirm).
• A sequence number is also included with the ACK
– Frame 0 is acknowledged by ACK 1 and vice-versa.
• The ACK sequence number always announce the sequence number of the next frame expected
by the receiver
31
Data link control: Stop-and-Wait ARQ
•The sender and the receiver use control variables
– Sender’s control variable
• V(S) = holds number of the next frame to be sent
– => V(S) is incremented when a frame is sent.
• When the timer expires, resend a copy of the actual frame, i.e. V(S-1).
– Receiver’s control variable
• V(R) = holds number of the next frame expected
– => V(R) is incremented when a frame is received.
• Stop-and-Wait ARQ operates in a half-duplex mode
– Only one frame outstanding : waiting for acknowledgment
32
Data link control: Stop-and-Wait ARQ
33
Data link control: Stop-and-Wait ARQ
34
Data link control: Continuous ARQ
• Pipelining is not used with Stop-and-Wait ARQ.
– Pipelining: a task began before the previous task has ended.
• Continuous ARQ protocols uses pipelining to improve the efficiency of
the transmission.
– Let more than one frame be outstanding -to keep the channel busy- while the sender
is waiting for an ACK.
• Continuous ARQ protocols consider the following:
– The sender sends frames continuously without waiting for an ACK to be returned.
• The sender retains a copy of each frame transmitted and not acknowledged in its retransmission-
list.
– The receiver returns an ACK to announce the correct frame reception.
– On receipt of an ACK, the corresponding frame(s) is (are) removed from the
retransmission list.
– Frames received free of errors are placed in the link-receive list to await processing.
• On receipt of the next in-sequence frame expected, the receiver delivers the frame content to the
upper-layer.
• On the receipt of an out-sequence frames, the receiver could do one of the following:
• Retain these frames in its link-receive list until the next in-sequence frame(s) is (are) received.
• The receiver never delivers out-of-sequence packets to the network layer.
• Discards these frames and waits for the expected frame.
• A full-duplex mode is used
• Two continuous ARQ protocols : 1) Go-Back-N, and 2) Selective Repeat.
35
Go-Back-N
ARQ
• The receiver performs the followings:
– Upon reception of a safe and in sequence frame, the receiver then sends an
acknowledgment.
• The receiver doesn’t have to acknowledge each frame received.
– ACK(N) acknowledges the frame (N-1) and all the previous ones.
• I.e. the acknowledgments are cumulative.
– Upon reception of a damaged or an out-of-sequence frame, the receiver will be silent
and will discard all subsequent frames until it receives the expected frame.
– The correct frame sequence is hence maintained => Minimizing the buffer storage
• The sender performs the following:
– Sends frames continuously.
– When the timer expires because of an unacknowledged frame (due to the silence of the
receiver), the sender go-back and resend all the outstanding frames.
– The sender could restrict itself to only one timer started with the 1st outstanding frame.
• Send all the outstanding frames when this timer expires.
•The sender and the receiver use control variables
– The sender’s control variables
• SF : holds the sequence number of the 1st (i.e. oldest) outstanding frame in the retransmission
list..
• SN: holds the sequence number of the next frame to be sent.
– The receiver’s control variables
• RN: holds the sequence number of the next frame expected.
• In fact, Stop-and-Wait ARQ is a special case of Go-Back-N ARQ with a sender
36
retransmission list size equals to 1.
Go-Back-N ARQ
37
Go-Back-N ARQ
• Lost acknowledgments: Two cases are possible
– A cumulative ACK arrives before the expiry of the timer
• No need to resend the frames
– ACK arrives after the expiry of the timer
• Resend all the frames starting with one for which timer has expired to the last one sent.
38
• Example
Go-Back-N ARQ
– What will happen if frame(0), frame(1), frame(2), and frame(3) are sent and frame(1) is lost.
– Note: When ACK(2) arrives, the sender is still busy with sending frame(3) (the physical layer must
wait until the data link layer goes to its sleeping state). A vertical line indicate the delay
39
Selective Repeat ARQ
• Go-back-N is inefficient in noisy links because it will resend multiple frames.
– In a noisy link, a frame has a higher probability of damage => resending multiple frames.
– Resending multiple frames consumes the bandwidth and slows down the transmission.
• Selective Repeat ARQ doesn’t resend N frames when just one frame is damaged.
– Only the damaged frame is resent with Selective Repeat ARQ.
– It is more efficient for noisy links, but the processing at the receiver is more complex.
• Some of the receiver actions
– Correct out-of-sequence frames are accepted and stored in the receiver-link list but not delivered to
the network layer
– Consecutive safely arrived frames starting with RN can be delivered to the network layer
– Send an ACK when packet is delivered to the network layer
– Or a cumulative ACK when many frames are delivered in one shot to the network layer.
– A NAK(N), a negative acknowledgment, is sent if one of these two situations happened
– The received frame(N) is corrupted.
– The received frame is not the one expected
– Send NAK(N) if RN=N and the received frame is frame(M) with M≠N.
– Only one NAK is send to not overwhelm the sender with NAKs.
– A NAK is sent once for each RN value.
• Some of the sender actions
– A timer is started for each frame sent.
– If a NAK is received, the corresponding frame is resent and its timer is restarted.
– If an ACK is received, stops the timer and purges the retransmission-list.
– If a timer expires, only the frame, which times out, is resent.
• The protocol uses the same control variables used with Go-Back-N.
40
Selective Repeat ARQ
• With reception of correct and in-sequence frames, the receiver sends the corresponding ACK or
a cumulative one, i.e. ACK(2).
– The in-sequence frames are delivered to the network layer.
• When the receiver receives an out-of-sequence frame, it stores this frame in its link-receive list
and sends NAK(RN), i.e. NAK(2).
– The out-of-sequence frames are stored and marked (colored slots) but not delivered to the network layer
– Only one NAK is sent to not overwhelm the sender.
• Once the missed frame is received (i.e. frame(2)), the in-sequence frames are sent to the
network layer and a cumulative ACK is sent, i.e. ACK(0).
41
Selective Repeat ARQ
• One timer is started with each sent frame.
– The timer is stopped when the ACK, for the corresponding frame, is received.
– The timer is stopped and restarted if a NAK, for the corresponding frame, is received.
• Out-of-sequence frames (frame(2) & frame(3)) are accepted (i.e. stored and marked (colored slots)) but are
not delivered to the network layer.
– Once the missed frame arrives, i.e. frame(1), can frame(1), frame(2), and frame(3) be delivered to the network layer.
• Only one NAK is sent to not crowd the network.
– After the second arrival, a NAK is sent. After the third arrival, no NAK is sent although both situations look the same.
42
Data link control :Flow control
• Flow control implementation
– Stop-and-wait flow protocol
• Implicit Flow Control: a sender must wait until an ACK is returned before transmitting the
next frame.
– Sliding window concept
• Used with both the continuous-RQ techniques
• Send sliding window: represents the range of sequence numbers which is the concern of the
sender.
– Send sliding window size = Retransmission list size of the sender.
–This window divides the possible sequence numbers in four regions
– The window slides to the right with the reception of ACKs.
- Ex. : ACKs 0, 1, and 2 have been received.
43
Data link control : Flow control
• Flow control implementation (cont’d)
– Sliding window concept (cont’d)
• Receive sliding window: represents the range of sequence numbers which is the
concern of the receiver.
– Used to make sure that the correct data frames are received and that the correct ACKs
are sent.
– Receive sliding window = link-receive list size of the receiver.
– The window slides when 1) a set of consecutive frames arrive, and 2) the set starts from the
beginning of the window.
• Fixed vs. dynamic sliding window size
– Some protocols could consider a dynamic sliding window size adapted over time
• The size is fixed for the techniques already presented
• The send and Receive sliding window size fixed limit
44
Data link control: Sequence numbers
• Recall
– The sequence number is carried in the frame - normally in the header- and it is possible to
reserve only a limited number of bits for the frame number.
– For example with a 3 bit sequence number, 8 sequence numbers are possible with the stream
of sequence numbers allocated like this (I.e. modulo 8): 0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0
– ACK sequence number conventions
• The sequence number represents the identifier of next frame expected by the receiver
• The sequence number represents the identifier of frame correctly received by the receiver (option
chosen here).
• Since the number of outstanding frames is fixed (k), the sequence numbers assigned to
frames can also be fixed (fixed number of bits).
–The number of identifiers is a function of both the retransmission control scheme and the size
of the send and receive windows.
• Idle-ARQ : minimum sequence number
– The sender transmits frame(0) and does not transmit frame(1) until Frame(0) has been
acknowledged..
– The two sequence numbers are required in the case that the ACK(0) is lost
• The sender times out and resends Frame(0)
– However the receiver is now waiting for Frame(1) and can reject Frame(0).
– In order to distinguish between a previous frame n and the next frame n, it is necessary that the number of sequence
numbers be greater than the window size
– Clearly, the sequence numbers for idle-ARQ may be 1 bit.( I.e. log2(number of sequence
numbers) = 1)
45
Data link control: Sequence numbers
• Go-Back-N : minimum sequence numbers
– If K is the window size, then the number of sequence number must be
one larger or K+1.
• In other words if the sequence numbers are 0, 1, 2, 3, . . . , 2s-1 then K = 2s-1.
• The window size cannot be equal to 2s .
1. The sender transmits 2s frames, using all the sequence numbers.
2. The frames are correctly received and ACK’s are sent, but they are all lost.
3. The frames (or only 1st outstanding one) time out and are retransmitted.
4.The receiver receives F(0) (a duplicate) but believes it to be the next frame in the
sequence, unknowing that the ACK’s did not get through.
• Having K = 2s-1 removes this possible error because the receiver will be expecting
F(2s-1) and returns NACK(2s-1) (or re-send an ACK for F(2s-2)) when receiving the
duplicate F(0).
•Usually K+1 is a power of 2 and K=2n-1.
– As a result, the frame send and receive numbers require n bits.
• Selective repeat : minimum sequence numbers
- Send & Receive Window Size = K
- Minimum required number of identifiers = 2K
46
Data link control: Sequence numbers
• Selective repeat (cont’d)
• Consider the following scenario:
• Suppose the sender sends full window K frames:
• The receiver correctly receives K I-frames and transmits ACK(0).. ACK(K-1)
• Suppose all ACKs corrupt
• The sender times out for K frames and retransmit all the frames
• The receiver must determine if any of these are new or duplicates
• Hence each frame must have unique identifiers
• K new identifiers (K..2K-1) assigned to next K-frames
• Original identifiers (0..K-1) identify 1st K frames
• => 2K identifiers required
– For selective-repeat, the number of sequence numbers must be 2K
• With a window of size K=2n-1 => requires n bits for the send and receive numbers.
47
Data link control: The code
• Stop-and-Wait (Sender side)
48
Data link control: The code
• Stop-and-Wait
(Receiver side)
49
Data link control: The code
• Go-Back-N (Sender side)
50
Data link control: The code
• Go-Back-N (Receiver side)
51
Data link control: The code
• Selective-Repeat (Sender side)
52
Data link control: The code
•Selective-Repeat (Receiver side)
53
Data link control : HDLC
• HDLC : High-level Data Link Control
• A bit-oriented protocol that can be used for point-to-point or multipoint
links.
• Implements ARQ mechanisms.
• Provides two common transfer modes
– NRM (Normal Response Mode)
• One (only one) primary station can send commands.
• A (among many) secondary station can only respond.
– ABM (Asynchronous Balance Mode) : commonly used mode
• Each station can function as a primary or a secondary station.
• Frames
– Three types of frames
• Information frames (I-frames)
– Used to transport user data and control information related to used data (piggyback)
• Supervisory frames (S-frames)
– Used only to transport control information. Ex: a station, with no data to send, sends an ACK
• Unnumbered frames (U-frames)
– Reserved for system management
54
Data link control : HDLC
• Frame format
– Flag field
• Sequence 01111110 that identifies both the beginning and the end of the frame
– Address field (?)
• If a primary station created the frame, it contains a to address.
• If a secondary station created the frame, it contains a from address.
– Control field
• Used for flow and error control. Depends on the frame type.
– Information field
• Contains user’s data from network layer or management information.
– FCS (Frame Check Sequence) field
• Error detection field. Contains an ITU-CRC 16 or 32 bits.
55
• Control fields
Data link control : HDLC
– The format is specific for the frame type.
• I-frames
– N(S) : defines the frame sequence number => 8 sequence numbers.
• With 2-byte control field (extension format), this field is larger.
– N(R): defines the ACK sequence number when piggybacking is used.
– P/F (Poll/Final): it has a meaning only when it is set 1.
• Poll: when the frame is sent from a primary station to a secondary one.
• Final: when the frame is sent from a secondary station to a primary one.
• S-frames
– No information field is used
– N(R) : ACK number or NACK number (depending on the S-frame type).
– Code : 2-bit that define the S-frame type:
• 00- Receive Ready (RR)- : S-frame type to acknowledge the receipt of a correct frame(s).
- N(R) represents an ACK. The ACK sequence number defines the next frame expected by the sender??.
• 10– Receive not Ready RNR)- : like RR S-frames with the announcement that the receiver is busy and cannot
receive more frames.
• 01- Reject (REJ)- : used to represent a NACK frame like the one used with Go-Back-N.
• 11- Selective Reject (SREJ): used to represent a NACK frame like the one used with Selective Repeat.
• U-frames
– Information field contains system management information.
– 2-bit and 3-bit code : used to identify 32 types of S-frames.
56
Data
link
control
:
HDLC
• Control fields (cont’d)
• Example
– Connection/Disconnection
•
•
•
•
•
•
U-frames can be used for connection establishment and release.
Node A asks for connection with SABM frame.
Node B gives a positive acknowledgement with UA frame.
Data can then be transferred between the two nodes.
Finally, A sends DISC frame to release the connection.
B confirms with UA frame.
– Piggyback without errors
•
•
•
•
A begins the information exchange with I-frame 0 followed by 1.
B piggybacks its ACK (of both frames) –N(R)- onto an I-frame of its own –N(S)-.
B transmits its 2nd and 3rd frame before accepting further frames from A => N(R) not changed.
A has send all its data, therefore, it sends an RR S-frame.
57
Data link control : HDLC
• Example
– Piggyback with errors
• B sends three data frames (0, 1, 2) and frame 1 is lost.
• When A receives frame 2, discards it and sends REJ frame (NACK) for frame 1. Go-back-N is used.
– The NACK acknowledges frame 0 and declares that frame 1 must be resent.
• When B receives REJ frame, it resends frames 1 and 2.
• A acknowledges the receipt by sending an RR frame (ACK) with ACK number 3.
58
Data link control : HDLC
•
59
Data link protocol : PPP
• PPP (Point-to-point protocol) -RFC 1661 (1662,1663)– The most common protocols for point to point access (i.e. dedicated link (no sharing))
– The Internet choice for home computer users
• The telephone line, connecting the computer through a modem, provides the service of the physical layer.
• The control and the management of the data transfer is done by PPP
• PPP services define:
– The format of the frame to be exchanged between devices
– How two devices negotiate the link establishment and data exchange.
– How network layer data are encapsulated in the data link frame
– How two devices authenticate each other.
– Provision of the support of a variety of network layer protocols.
– Provision of connections over multiple links
– Provision of network address configuration (ex. Temporary network address)
• PPP missing services:
– No flow control provision.
– Only CRC is used for error detection. It is the responsibility of the upper layer protocols to deal with
error control.
– No sophisticated addressing to handle multipoint configuration
60
PPP : Framing
• PPP is a byte-oriented protocol
– The flag byte pattern is 01111101 (treated as a byte not as a stream of bits)
• Frame format
– Flag
• PPP frame starts and ends with 1-byte flag
– Address
• A constant value set to 11111111 (broadcast address).
– Control
• Set to the constant value 11000000 because no flow control is provided with only error detection.
– Protocol
• Defines what is being carried in the data field: user data or other information.
– Payload field
• Carries the user data or other information. It is a sequence of bytes with the default maximum of 1500
bytes. The data is byte stuffed if the flag byte pattern appears. Padding is needed if the size is less than
maximum default value or the maximum negotiated value.
–FCS
• Frame check sequence which is a standard CRC.
61
PPP: Transition Phases
• PPP connection goes through transition phases
– Dead
• The link is not being used.
• No active carrier (at the physical layer) and the line is quiet.
– Establish
• Go into this phase when one of node starts communicating.
• Options are negotiated between the two parties during this phase..
– If the negotiation is successful, the system goes to the authentication phase (if required) or directly
to the networking phase
• Several packets may be exchanged.
– Authenticate
• An optional phase decided during the establishment phase.
• Several authentication packets are exchanged.
– If successful, go to the networking phase otherwise go to the termination phase.
– Network
• Negotiation for the network layer protocols is carried during this phase.
• PPP specifies that two nodes establishes a network layer agreement before data at the
network layer can be exchanged because PPP can supports multiple network layer protocol.
– Open
• Data transfer takes place at this phase.
• The connection remains in this phase until one of the endpoint wants to terminate the
connection.
62
PPP: Transition Phases
•PPP connection phases (cont’d)
–Terminate
• The connection is terminated in this phase.
• Several packets are exchanged between the two ends.
63
PPP: Multiplexing
• PPP is a data link layer protocol that uses three sets of other protocols
– Link Control Protocol (LCP)
• Responsible for establishing, maintaining, configuring, and terminating links.
• Provides also negotiation mechanisms to set options between the two endpoints.
– Both endpoints must reach an agreement about the options before the link can be established.
• All LCP packets are carried into the PPP payload.
• There are 11 types of LCP packets defined by the code field (defined in the LCP packet).
•
64
PPP: Multiplexing
• PPP sets of protocols (cont’d)
– LCP (cont’d)
•
•
Many options can be negotiated between the two endpoints inserted in the information field of an
LCP packet.
– The most common options
65
PPP: Multiplexing
• PPP sets of protocol (cont’d)
• Authentication protocols
– Authentication means validating the user identity.
• Authentication is very important because PPP is designed to be used over dial-up
links where user identity verification is necessary.
– Two protocols has been created by PPP for authentication
• Password Authentication Protocol (PAP)
- A simple authentication protocol procedure with two-steps process: 1) The user, who wants
to access the system, sends an authentication identification (username) and a password, and 2)
The system checks the validity of the identification and password and either accepts or denies
the connection
•
66
PPP: Multiplexing
• PPP sets of protocol (cont’d)
– Authentication protocols (APs)
• Two PPP authentication protocols (cont’d)
– Challenge Handshake Authentication Protocol (CHAP)
• A three-way hand-shaking protocol providing greater security than PAP.
- The password is kept secret; it is never sent online
1) The system sends to the user a challenge packet containing a challenge value (a few bytes)
2) The user applies a predefined function using the challenge value and his own password. The result is
sent to the system
3) The system does the same. If the result matches with the user result, the access is granted. Otherwise it
is denied. CHAP is more secure than LCP especially if the system changes the challenge value continuously.
67
• PPP sets of
PPP: Multiplexing
protocol (cont’d)
– Network Control Protocols (NCPs)
• PPP is a multiple-network layer protocol
– It can carry a network layer data packet from protocols defined by the Internet, OSI, Novel, etc.
– To do so, PPP has defined a specific Network Control Protocol for each network protocol
• IPCP (Internet Protocol Control Protocol)
– This protocol configures the link used to carry IP packets in the Internet.
– IPCP defines seven packets
• After the network layer configuration is completed by one of NCP, users can exchange data packets
from the network layer.
– Different protocol fields for different network layers
68
PPP: Multilink PPP
• PPP originally designed for a single-channel point-to-point physical link.
• Multilink PPP development has been motivated by the availability of multiple
channels in a single point-to-point link.
• A logical PPP frame is divided into several actual PPP frames.
• A segment of the logical frame is carried in the payload of an actual PPP frame.
– The protocol field is set to 0x003d to show that the actual frame is carrying a segment of a
logical PPP frame.
– A sequence number needs to be added to the actual PPP frame to show the fragment’s
position in the logical frame.
69
Multiple access
• Point-to-Point (dedicated) link (or channel) :
– A single sender on one side of the dedicated link and a single receiver on the other side of the dedicated
link.
• HDLC is an example of link-layer point-to-point protocol??
• Broadcast (i.e. multipoint) link (or channel):
– Multiple sending & receiving nodes use a shared link.
– Multiple access problem: How to coordinate access to a shared link to avoid that two different nodes
transmit at the same time (i.e. a collision)?.
• => Data link layer divided in two sublayers
– Upper sublayer : responsible for data link control.
– Lower sublayer: responsible for resolving access to the shared link.
• Not need of such a sublayer with a dedicated channel.
• Many protocols have been devised to handle access to a shared link.
70
Multiple access: Random Access (Contention)
• No station controls another station.
– Random access: the transmission is random among the stations.
– Contention: stations compete to access the medium.
• A station, that has data to send, uses a procedure defined by
the protocol to make a decision on whether or not to send.
– The decision depends on the medium state (idle or busy).
• If more than one stations tries to send, there is a collision
(i.e. an access conflict).
– Collided frames are either destroyed or modified.
– If even one bit of a frame coexists on the channel with one bit of
another frame, there is a collision and both will be destroyed.
71
Multiple access: pure ALOHA
• Each station sends a frame whenever it has a frame to send.
• It relies on receiver ACKs to deal with collisions.
– A sending station sends a frame and waits for the ACK.
– If the ACK doesn’t arrive after a time-out period, the sending station assumes a
collision and re-send the frame.
• Time-out period = maximum round trip propagation delay = 2*Tp (Tp : maximum
propagation time)
• A collision will happen again if the colliding stations (at least two) will
resend after the time-out.
• => After the time-out expiration, each station will wait for a random
amount of time before resending : Backoff-time TB
• After a maximum number of retransmission attempts Kmax, the station
gives up and try later.
• Binary exponential back-off
– Choose randomly R in [0,2k-1]
• K is set to 0 and is incremented after each collision until reaching Kmax=15 (or 10?)
– After 1st collision R is randomly chosen from {0,1}, 2nd collision from {0,1,2,3}, 3rd collision from {0,1,2,3,4,5,67}
– Adapt retransmission attempts number, K, to the estimated current network load.
– Backoff-time TB = R*Tp or R*Tfr
• Tp : maximum propagation time ; Tfr : Average frame transmission time.
72
Multiple access: pure ALOHA
• Vulnerable time
– Length of time in which there is a possibility of collision. = 2*Tfr. (fixed size frames are assumed)
• The end of B’s frame collides with the beginning of A’s frame.
• The beginning C’s frame collides with the end of A’s frame.
– This means that to avoid collision : 1) no station should send later than Tfr before A start transmitting and 2) no station should start
sending during the Tfr period that A is sending
73
Multiple access: slotted ALOHA
• Improve the efficiency of pure ALOHA by reducing the vulnerable time.
• The time is divided into slots of Tfr.
• Stations are forced to send only at the beginning of the slot time.
– A station that misses this moment, must wait until the beginning of the next time slot.
• => the station which started at the beginning of this slot has already finished sending its frame.
– Some central clock or other technique is needed to synchronize all stations.
• There is still the possibility of collision if two stations try to send at the beginning of
the same time slot.
• The vulnerable time is reduced to one-half => = Tfr .
74
Multiple access: CSMA
• Carrier ( i.e. signal) Sense Multiple Access (CSMA).
• CSMA minimizes the chance of collisions => increase performance.
• A station first senses –listen- (i.e. check medium state) the medium
before sending.
– If there is an ongoing transmission, the station will refrain from transmitting
• Collisions still exist because of the propagation delay
– A station may sense the medium and find it idle only because the first bit sent by
another station has not yet been received.
– The longer is Tp, the larger is the chance that a carrier-sensing node will fail to
sense an ongoing transmission.
• Vulnerable time = Tp (If not interesting for the TD, remove this concept)
– If the first bit of a frame reaches the end of the medium, every station will already
have heard it and will refrain from sending.
75
Multiple access: CSMA
•Persistence methods devised for carrier sensing
–What should a station do when the medium is busy or idle?
–1-Persistent
• After a station finds the line idle, it sends immediately (with probability 1)
– Leads to the highest chance of collision because many stations can send at the same time..
– Nonpersistent
• If the line is idle, the station sends its frame immediately.
• If the line is busy, the station waits a random amount of time (i.e. station backoff) before it can sense
the line again.
– Reduces the amount of collisions
• It is unlikely that two stations will wait the same amount of time before and retry to send simultaneously.
– Reduces efficiency
• The medium remains idle when there may be stations with frames to send.
– p-Persistent
• Is used if the channel is slotted.
– Channel time is divided in slots.
• Slot duration >= maximum propagation time.
– A station can sends only at the beginning of the time slot
• If the line is idle then
– 1) The station sends its frame with a probability p.
– 2) With a probability of q=1-p, the station waits for the beginning of the next time slot and checks the line again.
– If the line is idle, it goes to step 1.
– If the line is busy, it acts as though a collision has occurred and uses the backoff procedure.
– What is the effective value of p?
– Low value of p avoids instability in high load but increase delays under light loads.
76
Multiple access: CSMA
•Behavior of the persistence methods when a
station finds the channel busy.
• Flow diagram of the persistence
methods
77
Multiple access: CSMA/CD
• CSMA/CD (CSMA with Collision Avoidance) improves CSMA by handling
collision.
– When a sending station detects a collision during its frame transmission, it stops
transmitting rather than finishing the transmission
• Network capacity is saved.
• Example
– At t1, station A has executed its persistence procedure and starts sending its frame.
– At t2, station C has not sensed the first bit of A, executes its persistence procedure and starts
sending its frame.
– Station C detects a collision at t3, it immediately aborts transmission.
• Node C transmits for the duration t3-t2.
– Station A detects collision at t4 and aborts immediately the transmission.
• Node A transmits for the duration t4-t1.
78
Multiple access: CSMA/CD
• Minimum frame size
– Needs a restriction on the frame size to let CSMA/CD works.
– Before sending the last bit of the frame, the sending station must detect a collision
and aborts the transmission.
• Once the frame is sent, a frame copy is not kept and the station does not monitor the line
for collision detection.
– => No ACK (?).
– => TFrame >= 2*Tp.
• Formula get from the worst case scenario
– The two colliding stations are at the maximum distance apart.
– One Tp duration to let the signal from the first station signal reaches the second one.
– One Tp duration to let the collision reaches the first station.
– So, the first station must still be transmitting after 2* Tp.
– Example.
• A network using CSMA/CD has a bandwidth of 10 Mbps. If the maximum propagation
time (including the delays in the devices and ignoring the time needed to send a jamming
signal, as we see later) is 25.6 μs, what is the minimum size of the frame?
– The frame transmission time is Tfr = 2 × Tp = 51.2 μs.
• This means, in the worst case, a station needs to transmit for a period of 51.2 μs to detect the
collision.
– The minimum size of the frame is 10 Mbps × 51.2 μs = 512 bits or 64 bytes.
• This is actually the minimum size of the frame for Standard Ethernet
79
Multiple access: CSMA/CD
80
Multiple access: CSMA/CD
• Differences between CSMA/CD and ALOHA
– Sense the channel before sending using one of the persistence processes.
– The transmission and collision detection is a continuous process (shown as a loop).
• The station transmits and receives simultaneously (using two different ports) until one of these two
conditions is detected
– Transmission finished.
– Collision detected.
– Sends a short jamming signal that enforces the collision in case other station have not yet
sensed the collision.
• Node B has transmitted only a few bits when it detects A’s transmission and aborts its transmission.
These few bits may not be enough for A to detect the collision.=> B transmits a jam signal
• Channel Energy model monitored by each station
– Three values for a channel energy level
• Zero => idle channel
• Normal => the station has successfully captured the channel and is sending its frame.
• Abnormal (twice the normal level of energy) => collision.
– NB: The maximum bus length should be restricted to no let the signal greatly attenuated.
81
Multiple access: CSMA/CA
• CSMA/CA : CSMA with Collision Avoidance
• When there is no collision, the sending station receives only its signal.
• When there is a collision, the sending station receives two signals: its
own and the one sent by the other station.
– To distinguish between these two cases, the received signals in these two cases
must be significantly different.
• In wired networks, because of repeaters and the shortness of the cable,
the received signal has almost the same energy as the sent signal.
– This allows detecting collision because the signal energy is almost double during a
collision.
• In wireless networks, most of the energy is lost in transmission. The
received signal has very little energy
– This is not useful for effective collision detection.
• Need to avoid collision on wireless networks because they cannot be
detected => CSMA/CA
• CSMA/CA uses three strategies
– Interframe space.
– Contention window.
– Acknowledgements.
82
Multiple access: CSMA/CA
• Interframe space (IFS)
– Collisions are avoided by deferring transmission even the channel is found idle.
– When an idle channel is found, the station should wait an IFS.
• To allow the front of a transmitted signal by a distant station to reach the station that wants to
send and has sensed the channel idle.
– If after IFS time the channel is still idle, the station can send (but still needs to wait a time
equals to the contention time).
– Different IFS can be used to prioritize stations or frame types
• Contention window
– Amount of time divided into slots.
– A station that is ready to send, chooses a random number of slots as its wait time.
• The number of slots in the window changes according to the binary exponential back-off
strategy.
– Sense the channel after each time slot
• If the channel is busy, the timer is just stopped
• The timer is restarted when the channel is sensed as idle.
• => Gives the priority to the station with the longest waiting time.
• Acknowledgements
– The two previous strategies are not enough to avoid collision.
• Data could be corrupted during transmission.
– Acknowledgements and time-out timer can help to guarantee that the receiver receives the
frame.
83
Multiple access: CSMA/CA
•CSMA/CA timing
•CSMA/CA flow diagram
84
Multiple access: controlled access
• Stations consult one another to find which station has the
right to send.
– A station cannot send unless it has been authorized.
• Controlled access methods
– Reservation
• A station needs to make a reservation before sending data.
• Time is divided into intervals.
• In each interval, a reservation frame precedes the data frames sent in that interval.
– Polling
• All data exchanges need to be made through the primary device.
• The primary device controls the link
– It is up to it to determine which device is allowed to use the channel.
• The secondary device follow its instructions.
– Token passing.
• The stations are organized in a logical ring
• Each station has a predecessor and a successor.
• A special packet, called a token, circulates through the ring.
• A node is permitted to transmit only when it has the token.
85
Multiple access: channelization
• The available bandwidth of a link is shared in time,
frequency, or through code, between different stations.
• Channelization methods
– FDMA (Frequency-Division Multiple Access)
•
•
•
•
The available common bandwidth is divided into frequency bands.
Each station is allocated a band to send its data.
Each station also uses a bandpass filter to confine the transmitter frequencies.
FDMA is different from FDM.
– TDMA (Time-Division Multiple Access)
• The stations share the bandwidth of the channel in time.
• Each station is allocated a time slot during which it can send data.
• TDMA is different from TDM.
– CDMA (Code-Division Multiple Access)
• The stations use different codes to achieve multiple access.
86
Wired LANs: IEEE standards
• LAN market has seen several technologies, such as Ethernet, Token Ring, Token Bus,
FDDI, and ATM LAN.
– Ethernet is the most used technology.
• IEEE standards
– IEEE project 802 : a set of standards to enable intercommunication among equipment from a
variety of manufacturers. Standard examples:
•
•
•
•
•
IEEE 802.3 (Ethernet): bus-based LAN standard.
IEEE 802.4: token-bus LAN standard.
IEEE 802.5: token-ring LAN standard.
IEEE 802.11: wireless LAN standard.
IEEE 802.15: BLUETOOTH LAN.
– IEEE project 802 doesn’t replace OSI or Internet model but it is a way of specifying
functions of the physical and data link layer of major LAN protocols.
•The relationship of the 802 standards and the OSI model
87
Wired LANs: IEEE standards
• IEEE standard Data link layer
– Divided into two sublayers: LLC and MAC
– Logical Link Control (LLC)
• Handles : flow control, error control, part of the framing duties.
– Three services are provided as alternatives
• Unacknowledged connectionless service.
• Connection-mode service.
• Acknowledged connectionless service.
• Provides one single data link control protocol for all IEEE LANs.
• Most upper-layer protocols, such IP, do not use the LLC services.
– Media Access Control (MAC)
• IEEE 802 project has defined the specific access method for each LAN.
– CSMA/CD as the Ethernet MAC, Token-passing method for Token Ring, etc.
• Part of the framing function is also handled by the MAC layer.
• In contrast to LLC, MAC sublayer contains a number of distinct modules where each
defines the access method and the framing format specific to the corresponding LAN
protocol(=> different protocols for different LANs).
• IEEE standard physical layer
– Dependent on the implementation and the type of the physical media used.
– IEEE defines detailed specifications for each LAN implementation
– Ex.: Standard Ethernet
• Different physical layer specifications for each Ethernet implementations.
88
Wired LANs: Standard Ethernet
• Originally developed by Xerox, become a joint venture between DEC,
Intel, and Xerox.
• Standardized by IEEE under 802.3.
• Ethernet gone through four generations: standard Ethernet, Fast
Ethernet, Gigabit Ethernet, and Ten-Gigabit Ethernet.
• Standard Ethernet MAC sublayer
– Governs the operation of the access method.
– Frames data received from upper layer and passes them to the physical layer.
– No acknowledgements=>Provides an unreliable medium.
– Frame format
– Frame length : restriction on the minimum and the maximum frame length
• The minimum length restriction is required for the correct operation of the CSMA/CD.
– An Ethernet frame needs to have a minimum length of 512 bits or 64 bytes (header and trailer
included).
 Minimum length of the payload = 46 bytes. Padded with blank if less than 64bytes.
• The maximum length of a frame is 1518 bytes (without preamble and SFD).
– Maximum length of the payload = 1500 bytes.
– This restriction is related to : 1) reduces buffer requirements as memory was expensive at the time
Ethernet was designed , 2) prevents one station to monopolize the medium
89
Wired LANs: Standard Ethernet
• MAC sublayer (cont’d)
– Addressing
• Each station has its own (i.e. unique) network interface card (NIC).
• Each NIC provides the station with a 6-byte (48 bits) physical address written in
hexadecimal notation with colon between.
– 06 : 01 : 02 : 01: 2C : 4B
– Unicast, Multicast, and broadcast addresses
• A source address could only be a unicast address, i.e. comes from only one station.
• A destination address could be unicast, multicast, or broadcast address.
– Unicast: only one recipient.
– Multicast: a group of recipients.
– Broadcast: all the recipients.
• If the least significant bit of the first byte in a destination address is 0, the address is
unicast; otherwise, it is multicast.
• A broadcast destination address is forty-eight 1s.
– The address transmission is different from the written hexadecimal notation
• The transmission is left-to-right, byte by byte.
• For each byte, the least significant bit is sent first (i.e. from right-to-left).
– The bit that defines an address as multicast or unicast arrives first.
90
Wired LANs: Standard Ethernet
• MAC sublayer (cont’d)
– EX.
• Define the type of the following destination addresses: a) 4A:30:10:21:10:1A, b)
47:20:1B:2E:08:EE, c) FF:FF:FF:FF:FF:FF
– The address type is defined by the second hexadecimal digit from the left.
• If it is even, the address is unicast.
• If it is odd, the address is multicast.
• If all digits are F’s, the address is broadcast.
– a. This is a unicast address because A in binary is 1010.
– b. This is a multicast address because 7 in binary is 0111.
– c. This is a broadcast address because all digits are F’s.
• Show how the address 47:20:1B:2E:08:EE is sent out on line.
– The address is sent left-to-right, byte by byte
– For each byte, it is sent right-to-left, bit by bit
– Access method : CSMA/CD
• Uses 1-persistent CSMA/CD
91
Wired
LANs:
Standard
Ethernet
• MAC sublayer (cont’d)
– Slot time
• Slot time = round-trip time + time required to send jam sequence.
• Slot time in Ethernet is defined in bits : time required to send 512 bits.
• Depends on the data rate.
– For traditional 10-Mbps Ethernet it is 51.2 ms.
– Slot time and collision
– 512-bit slot time is chosen to allow proper functioning of the CSMA/CD.
– 512-bit slot time allows a sending of a frame with a minimal length (i.e. worst-case) to detect an
eventually collision before it terminates to send the entire frame.
– Slot time and maximum network length (collision domain)
• Slot time and maximum length of the network are inter-related.
– Maximum length depends on the propagation speed of a signal in the medium.
• MaxLength = PropagationSpeed*SlotTime/2 = (2*108)*(51.2*10-6/2)=5120m.
• Need to consider the delay times in repeaters and interfaces and the time required to send
jam sequence => reduce the maximum length to 2500m
• Physical layer
– Defines several physical layer implementations. The most common are:
92
Wired LANs: Standard Ethernet
• Physical layer (cont’d)
– Encoding and decoding
• All standard implementations use digital signaling (baseband) at 10Mbps.
• Many xBase-y acronyms: x means the speed of the technology (10Mbps), Base refers to
baseband transmission, and y refers to the physical media itself (or length?).
• At the sender data is converted to a digital signal using Manchester scheme.
• At the receiver the Manchester signal is decoded into data.
– 10Base5: Thick Ethernet (or Thicknet)
• First implementation
• Uses a bus topology with an external transceiver connected via a tap to a thick coaxial
cable.
• Transceiver (transmitter/receiver) responsible for transmitting, receiving, and detecting
collisions.
• Transceiver cable connects the station to the transceiver.
• Collision can only happen in the coaxial cable.
• Maximum length of coaxial cable must not exceed 500m,
• Otherwise signal degrades excessively.
• If a length of more than 500m is needed, up to five segments (i.e. use of 4 repeaters),
each of 500m, can be connected using repeaters.
93
Wired LANs: Standard Ethernet
• Physical layer (cont’d)
– 10Base2: Thin Ethernet (or Cheapernet)
• Uses a bus topology with a cable much thinner and more flexible.
• The transceiver is part of the NIC installed inside the station.
• Collision can only occurs in the thin coaxial cable
• Implementation more cost effective than 10Base5 because the cable is less expensive.
Installation is also simpler.
• The segment length cannot exceed 185m (close to 200) due to high level of attenuation.
– 10Base-T: Twisted-Pair Ethernet
• Uses a physical star topology.
• Stations are connected to the hub via two pairs of twisted cables.
– One for sending and one for receiving.
• Any collision happens in the hub.
• The maximum length of the TP cable is defined as 100m to minimize the effect of
attenuation in the TP cable.
94
Wired LANs: Standard Ethernet
•Physical layer (cont’d)
–10Base-F: Fiber Ethernet
• Uses a star topology to connect stations to a hub.
• The stations are connected to the hub using two optical-fiber cables.
–Summary
95
Wired LANs: Bridget Ethernet
• 10-Mbps standard Ethernet has gone through several changes before moving to the
higher data rates and become compatible with other higher data rate LANs.
• 1) Bridget Ethernet, 2) Switched Ethernet, and 3) Full-Duplex Ethernet.
• The first evolution of the Ethernet was the division of the a LAN by bridges.
• Bridges have two effects on an Ethernet LAN:
–1) Raising bandwidth.
• In unabridged Ethernet, the total capacity (10Mbps) is shared among all stations (12 in the ex.) with
frames to send.
• A bridge divides the network into two or more networks where each network is independent and with
10Mbps as a capacity.
– In the ex. the 10Mbps in each segment is now shared by 6 stations
 Really among 7 because the bridge acts as a station in each segment.
 Each station is theoretically offered 10/6Mbps instead of 10/12Mbps (assuming that the traffic is not going through the bridge)
– We can gain more bandwidth per segment if we further divide the network.
96
Wired LANs: Bridget Ethernet
• Bridges have two effects on an Ethernet LAN (cont’d):
–2) Separating collision domains.
• The collision domain becomes much smaller and the probability of collision is
reduced.
– EX.
• Without bridging, 12 stations contend for access to the medium.
• With bridging (using a four-port bridge), only 3 stations contend for access to the
medium.
97
Wired LANs: Switched Ethernet
• Instead of having two to four networks, using a bridge, why not have N
networks where N is the number of stations on the LAN?.
–i.e. Why not have an N-port switch?
• In this way, the bandwidth is shared only between the station and the
switch (5Mbps each).
• In addition, the collision domain is divided into N domains.
• A layer 2 switch is an N-port bridge with additional sophistication that
allows faster handling of the packets.
98
Wired LANs: Full-duplex Ethernet
• One limitation of 10Base5 and 10Base2 is that communication is halfduplex.
– 10Base-T is always full-duplex.
• The Full-duplex switched Ethernet is the next evolution that increases the
capacity of each domain from 10 to 20 Mbps.
• Two links are used between the station and the switch
– One to transmit, and one to receive.
• No need for CSMA/CD because each station can send and receive
independently without worrying about collision.
– => Carrier sensing nor collision detection are no longer needed
• A new sublayer, called MAC control (between LLC and MAC), is
added to provide flow control and error control.
– Standard Ethernet has a connectionless MAC protocol
• No explicit flow control or error control.
99
Wired LANs: Fast Ethernet
• IEEE created the fast Ethernet under the name 802.3u to compete with LAN protocols
such as FDDI or Fiber Channel.
• Fast Ethernet is backward-compatible with Standard Ethernet but can transmit data 10
times faster, i.e. at 100Mbps.
• 1) keep the 48-bit address, 2) keep the same frame format, and 3) keep the same minimum and
maximum frame lengths.
• MAC sublayer
– Consideration: keep the MAC sublayer untouched.
•Keep only the star topology (no bus).
• Half-duplex approach: stations are connected via a hub.
– CSMA/CD is the access method.
• Full-duplex approach: connections made via a switch with buffers at each ports.
– No need to CSMA/CD as an access method.
– Autonegotiation capability.
• Allows two devices to negotiate the mode or data rate of operation.
– EX.: A device with a maximum capacity of 10Mbps can communicate with one with 100Mbps.
• Physical layer
– More complicated than Standard Ethernet.
– Topology
• If there only two station, point-to-point connection is used.
• If there are more than two stations, a hub or a switch is used.
– Implementation : can be categorized as
• Two-wire implementation: either category 5 UTP (100Base-TX) or fiber-optic cable (100Base-FX).
• Four-wire implementation: category 3 UTP (100Base-T4).
100
Wired LANs: Fast Ethernet
• Physical layer (cont’d)
– Encoding
• Manchester encoding not adequate
– Needs a higher signal rate (200Mbaud) to allow the 100Mbps => unsuitable for TP cables for
example.
• Three different encoding schemes are used each for each implementation
– 100Base-TX
• Uses two-pair of TP cable (cat 5 UTP or STP).
• MLT-3 with 4B/5B encoding schemes are used.
– 100Base-FX
• Uses two pair of fiber-optic cables.
• NRZ-I with 4B/5B encoding schemes are used.
– 100Base-T4
• Use cat 3 or higher UTP (adv.: keep the voice-grade TP already wiring buildings).
• Uses four pairs of UTP.
• 8B/6T encoding scheme is used.
101
Wired LANs: Gigabit Ethernet
• Results from the need of higher data rate (1000Mbps=1Gbps).
• IEEE committee calls this standard 802.3z.
• Goals
• 1) compatible with standard and fast Ethernet, 2) keep the 48-bit address, 3) use the same frame
format, 4) keep the minimum and maximum frame lengths, and 4) support autonegotiation.
• MAC sublayer
– Full-Duplex mode
• A central switch is connected to all computers or other switches.
• No collision => CSMA/CD not used.
• Maximum length of the cable is determined by only the signal attenuation.
– Half-Duplex mode
• It is rarely used (to be compatible with previous generations).
• A switch is replaced by a hub where collision occur. CSMA/CD is used.
• Maximum cable length is dependent on the minimum frame size. Three methods
– Traditional
• Keep the minimum frame length as in traditional Ethernet (i.e.512 bits)
• However the length of a bit is 1/100 shorter than is 10Mbps Ethernet => slot time = 0.512ms.
• => Maximum length of the network is 25m. Suitable only if all stations are in one room.
– Carrier extension
•
•
•
•
•
Increase the minimum frame length to allow a longer network
Minimum frame length = 512 bytes (i.e., 8 times longer).
Use padding (i.e. extension bits) to any frame less than 512 bytes.
Maximum length of the network is 200m.
100m from the hub to the station.
102
Wired LANs: Gigabit Ethernet
• Mac sublayer (cont’d)
– Half-duplex modes (cont’d)
• Frame bursting
• Send multiple frames rather than adding extension to each frame.
• Padding is added between frames so that the channel is not idle..
• Physical layer
– More complicated even than fast Ethernet
– Topology
• If there only two station, point-to-point connection is used.
• If there are more than two stations, a hub or a switch is used.
• Another possible configuration: connect several star topologies or let a star topology be part of
another.
103
Wired LANs: Gigabit Ethernet
• Physical layer
– Implementation
• Two-wire implementation
– Uses fiber-optic cable (1000Base-SX, short-wave, or 1000Base-LX, long wave) or STP
(1000Base-CX).
• Four-wire implementation
– Uses cat. 5 TP cable (1000Base-T).
– Designed to those who had already a Fast Ethernet or Telephone wiring.
• Encoding
– Manchester encoding could not be used because involves very high bandwidth.
– The two-wire implementations use NRZ with 8B/10B schemes.
• One wire for sending and one wire for receiving.
– The four-pair implementation uses 4D-PAM5 encoding.
• All four wires are involved in both input and output with each wire carries 250Mbps.
104
Wired LANs: Ten-Gigabit Ethernet
• IEEE called this standard 802.3ae aiming to upgrade the data rate to
10Gbps.
• Goals
• 1) compatible with the previous Ethernet, 2) use the 48-bit address, 3) use the same frame
format, 4) keep the same minimum and maximum frame lengths, 5) allow the
interconnection of existing LANs with a MAN or a WAN, and 6) make Ethernet
compatible with other technologies like Frame Relay and ATM
• MAC sublayer
– Operates only in full-duplex mode => no need to use CSMA/CD.
• Physical layer
– Designed for using optical-fiber cable over long distances.
– Three implementations are the most common: 10GBase-S, 10GBase-L, and
10GBase-E.
105
Connecting LANs
• LANs do not normally operate in isolation.
– They are connected to one another or to the Internet.
• Connecting devices are used to connect LANs or segments of LANs.
• Connecting devices can operate in different layers in the Internet
model.
•So, connecting devices can be divided in five categories based on the
layer in which they operate in a network.
106
• Passive hub
Connecting LANs
– Location: below the physical layer.
– It is part of the media.
– It is just a connector: the arriving bits on a hub port are recreated on all the other hub ports.
• It connects the wires coming from different branches.
– In a star topology Ethernet-LAN, the passive hub is the collision point.
• Point where the signals coming from different stations collide: Bits coming from different ports collide.
• Repeater
– Operate in the physical layer.
– A repeater does not actually connect two LANs; it connects two segments of the same LAN.
• It can extend the physical length of a LAN.
• It can overcome the 10Base5 Ethernet length restriction (i.e. 500m) by joining a LAN’s portions (i.e.
segments).
– A repeater is a two-port node forwarding every received frame; it has no filtering capability.
– A repeater is a regenerator, not an amplifier.
• An amplifier amplifies equally both the intended signal and the noise.
• A repeater regenerates the signal (not amplifies the signal).
• When it receives a weakened or corrupted signal, it creates a copy –bit for bit- at the original strength.
– Importance of the repeater location on a link: place it so that a signal reaches it before any noise
can change the meaning of any of the signal bits.
107
• Active hubs
Connecting LANs
– It is a multiport repeater operating on the physical layer.
– Used to create connections between stations in a physical star topology.
– Examples of active hubs are the Ethernet implementations (10Base-T, for example).
– Hubs can also be used to create multiple levels of hierarchy.
• In the ex. This hierarchy removes the length limitation of 10Base-T (100 m).
• Bridges
– Interconnecting device that provides a means of interconnecting similar LANs.
• i.e., using identical protocols for the physical and data-link layers (ex. All conforming IEEE 802.3)
– A bridged LAN is better than one large LAN
• Reliability, performance, security, geography.
– Operate in both the physical and the data link layer.
• As a physical layer device, it regenerates the signal it receives.
• As a data link layer device, it can check the frame physical (MAC) addresses (src & dst).
– Filtering
• Check the frame destination address and decide if the frame should be forwarded or dropped.
• Specify a port if the frame is to be forwarded.
– Uses a table that maps addresses to port.
• A bridge does not change the MAC addresses in a frame.
108
Connecting
LANs
• Bridges : Filtering (cont’d)
• Ex.1:
– Two LANs are connected by a two-port bridge (a bridge can have more than two ports).
– A frame is destined for station 712B13456142 arrives at port 1 of the bridge
– According to its table, such frame leaves through port 1 => the frame will be dropped.
– In this case, LAN2 remains free of traffic.
• Ex. 2:
– A frame destined for 712B134456141 arrives at port 2.
– According to its table, such frame will be forwarded at port 1.
– In this case, both LANs have traffic.
• A bridge accesses the medium as a simple node
– It should uses the medium access protocol used on LAN1 when sending on LAN1.
– It should also uses the medium access protocol used on LAN2 when sending on LAN2
• IEEE 802.1D specification defines the protocol architecture for a bridge.
109
Connecting LANs
• Transparent Bridges
– Stations are completely unaware of the bridge’s existence.
• The deletion or addition of a bridge doesn’t require station reconfiguration.
– IEEE802.1d specification on transparent bridges is based on:
• 1) Correct frame forwarding, 2) Dynamic forwarding table by learning, 3) Prevents loops.
– Forwarding
• Must correctly forwards frames.
– Learning
• Earliest bridges had static forwarding tables.
– Drawback: System administrator modify these table manually upon a station is added, is delete, or
its MAC address is changed (i.e. station’s NIC is changed).
• Better solution : dynamic tables that map addresses to ports automatically.
• The frame movements let the bridge learn and fill the table dynamically.
– The frame destination address is used for the forwarding decision (i.e. table lookup).
– The frame source address is used for adding entries to the table or updating purposes.
• EX.
– Station A sends a frame to station D
– The bridge doesn’t have an entry for either D or A.
– => The frame goes out from all three ports : the frame floods the network.
– The bridge learns, by looking the source address, that station A must be located on the LAN
connected to port1.
 In the future, frames destined to A will be sent on port 1.
 => the table has one entry now.
110
Connecting LANs
• Transparent Bridges (cont’d)
– Learning (cont’d)
• EX. (cont’d)
– When station E sends a frame to station A, the bridge uses its table to forward the frame to port 1.
 No flooding is necessary.
– It adds also a second entry for E (the source address) in its table.
– When station B sends a frame to C, the bridge has no entry to C.
 => it floods the network.
 Adds a new entry to the table for B.
– This process of learning continues as the bridge forwards frames.
111
Connecting LANs
• Transparent Bridges (cont’d)
– Loop problem
• Redundant bridges create loops in the system.
– Redundant bridges are placed between LANs to make the system more reliable.
 If a bridge fails, another takes over.
• EX.
– Station A sends a frame to station D.
– The tables of both bridges are empty.
– Both forward the frame and update their tables based on the source address A.
– Two copies of the frame A are now on LAN2 because a bridge is like a node, i.e. uses
CSMA/CD to access the network
 The copy sent by bridge1 is received by bridge2 which floods it because it has no information
about D.
 The same process happens with this new copy with the bridge1.
 Tables of both bridges are updated.
– Two copies of the frame A are now on LAN1.
• The same is repeated and both copies flood the network.
– This process continues on and on.
112
Connecting LANs
113
Connecting LANs
• Transparent Bridges (cont’d)
– Spanning tree
• Is the requirement from IEEE specification to create a loopless topology
• Definition
– In graph theory, a spanning tree is a graph without loops.
– In a bridged LAN, this means creating a topology where each LAN can be reached
from any other LAN through one path only (i.e. no loop).
• Representation of a network in graph theory.
– LANs and bridges are represented as nodes.
 In some textbooks : LANs as nodes and bridges as arcs.
– Connections between LANs and bridges are represented by arcs.
– A cost (metric) is assigned to each arc.
 Cost is administrator choice: minimum hops, minimum delay, or maximum bandwidth.
 In case of equality between two ports, the administrator just chooses one.
 Hop count is normally 1 from a bridge to the LAN and 0 in the reverse direction.
114
Connecting LANs
115
Connecting LANs
• Transparent Bridges (cont’d)
– Spanning tree (cont’d)
• Spanning tree steps
– Step 1
 Each bridge broadcasts its ID (a unique built-in serial number).
 All bridges will know which one has the smallest ID.
 The bridge with the smallest ID will be the root bridge (root of the tree).
 Assume Bridge B1 has the smallest ID => root bridge.
– Step 2
 The algorithm tries to find the shortest path (i.e., with the shortest cost) from the root
bridge to every other bridge or LAN. The shortest path can be found by examining the
total cost from the root bridge to the destination.
– Step 3
 The combination of the shortest paths creates the shortest tree.
– Step 4
 Based on the spanning tree
Mark the forwarding ports –that are part of the spanning tree- (that will forward frames that the
bridge receives)
Mark the blocking ports –that are not part of the spanning tree- (that will block the frame received by
the bridge).
– A single path exists from any LAN to any other LAN in the spanning tree => no loops.
• EX.: only one path between LAN1 to LAN2,
116
Connecting LANs
•Transparent Bridges (cont’d)
– Spanning tree (cont’d)
- Shortest paths and the spanning tree.
- Forwarding and blocking ports after spanning
tree algorithm.
117
Connecting
LANs
• Transparent Bridges (cont’d)
– Dynamic algorithm
• The spanning tree algorithm is carried out dynamically by each bridge.
• Bridges send special messages (BPDUs (Bridge Protocol Data)) to one another to update the spanning
tree.
– The spanning tree is updated with changes in the system : a failure of a bridge, addition of a bridge, or deletion of
a bridge.
– Source Routing Bridges
• Another way to prevent loops with redundant bridges.
• The duties of filtering frames, forwarding, and blocking are performed by the source station (and, to
some extent, the destination station) rather than by the transparent bridges.
• The sending station defines the bridges that the frame must visit.
– The bridges addresses are then included in the frame in addition to the source and destination addresses.
• The source gets these bridge addresses through exchange of special frames with the destination prior
to sending the data frame.
• Source routing bridges designed to be used with the IEEE Token Ring LANs.
– Sophisticated bridges can connect between different LANs
• A bridge should be able to connect LANs using different data link layer protocols : Ethernet LAN to
Wireless LAN.
• The following issues should be considered
–
–
–
–
–
–
Frame format.
Maximum data size.
Data rate.
Bit order.
Security.
Multimedia support.
118
• Two-layer Switches
Connecting LANs
– The term “switch” must be clarified by adding the level at which it operates.
– Three-layer switch is used at the network layer
• It is a kind of router.
– Two-layer switch performs at the physical and the data link layer
– Two-layer switch is a bridge with many ports
• Connects few LANs with a few ports or could connects stations if many ports.
– Like a bridge, it makes filtering decision based on the MAC address of the frame received.
• The filtering function determines whether a frame should be forwarded to some port or just be dropped.
• The filtering is based on a forwarding table filled using a learning process.
– Can be more sophisticated than a bridge
• Can have a buffer to hold frames for processing.
• Can have a switching factor to forward the frame faster.
• Routers
– Is a three-layer device that routes the packets based on their logical addresses
– A router normally connects LANs and WANs in the Internet.
– Has a routing table used for making decisions about the route.
– Routing tables are normally dynamic and are updated using routing protocols.
119
Connecting LANs
• Three-layer switches
– It is a router but faster and more sophisticated.
• Gateway
– Is a computer that operates in all five layers of the Internet
or seven layers of the OSI model.
– It takes an application message, reads it, and interprets it.
– So, it can be used as a connecting device between to
internetworks using different models.
• EX. A network designed to use the OSI model and a network
designed to use the Internet model.
• The gateway in such a case can take a frame as it arrives from the
1st system and move it up to the OSI application layer, and remove
the message.
120
Backbone networks
• A backbone network allows several LANs to be connected.
– Connecting devices are used to connect these LANs.
• No station is directly connected to the backbone;
– The stations are part of the LANs.
• The backbone is itself a LAN using a LAN protocol such as Ethernet
where each connection to this backbone is itself another LAN.
• Two common backbone architectures: 1) bus, and 2) star.
• Bus Backbone
– The topology of the backbone is a bus.
– The backbone can use one of the protocols that supports the bus topology
• Ex.: 10Base5 or 10Base2.
– Normally used to connect different buildings in an organization.
• Each building comprises a backbone connecting the floor’s LANs.
– Ex.: bridge-based backbone with four LANs.
• The bridge blocks the frame sent by a station in a LAN to another station in the same LAN.
• The bridge passes a frame, sent by a station in a LAN to station in another LAN, to the
backbone.
• The appropriate bridge receives the frame which is delivered to the destination.
121
Backbone networks
• Star backbone (collapsed or switched backbone)
– The topology of the backbone is a star.
– In such a configuration, the backbone is just a switch that connects the LANs.
– EX.: a star backbone where the switch does the job of the backbone and at the same
time connects the LANs.
• In a multifloor building, a LAN serves each particular floor.
• The backbone network (a switch) is installed and separate cables can run from the switch
to each LAN (or the hub or switch if the LAN is based on a star topology).
122
Backbone networks
• Connecting remote LANs
– Another common application of a backbone network: connects remote LANs.
• Useful for a company that has several offices with LANs and needs to connect them.
– The connection can be done through bridges –called remote bridges-.
– The bridges act as connecting devices that connect LANs and point-to-point
networks –such leased line or ADSL-.
• The point-to-point network is considered a LAN without a station.
• PPP protocol can be used on the point-to-point link.
123
Virtual LANs : VLANs
• VLAN acts as a local area network configured by software, not by physical wiring.
– Allows virtual connection between stations belonging to different physical LANs.
• EX.
– Consider a switched LAN in an engineer firm in which 10 stations are grouped into three
LANs that are connected by a switch.
– The LAN is configured to allow the following arrangement
• 1) the 1st four engineers work together as the 1st group, 2) the next three work together as the 2nd group,
and 3) the last three work together as the 3rd group.
– If two engineers have to move from the 1st group to the 3rd group (to speed up the project),
the LAN configuration needs to be changed (=> physical changes in the network
configuration (i.e. network rewiring)).
• The problem is repeated if other engineers have to move.
124
• EX. (cont’d)
Virtual LANs : VLANs
– Same switched LAN divided into VLANs.
• The idea of VLAN technology is to divide a LAN into logical, instead physical,
segments.
• A LAN can be divided into several logical LANs (called VLANs).
• Each VLAN is a workgroup in the organization.
• If a person moves from one group to another group, there is no need to change the
physical configuration.
• The group membership in VLAN is defined by software not hardware.
• All members belonging to a VLAN can receive broadcast messages sent to that
particular VLAN.
– If a station moves from VLAN1 to VLAN2, it will receive broadcast messages sent to
VLAN2 but not broadcast messages sent to VLAN1
125
Virtual LANs : VLANs
• VLAN technology even allows the grouping of stations connected to different switches in a
VLAN.
• Example:
– A backbone LAN with two switches and three VLANs.
– Stations from switches A and B belong to each VLAN.
– Good configuration for a company with two separate buildings each with its own switched LAN
connected by a backbone.
• People in the 1st building and people in the 2nd building can be in the same group even though they are connected to
different physical LANs.
• VLANs create broadcast domains.
– The stations in a VLAN communicate with one another as though they belong to a physical segment
while they can belong to different physical LANs.
126
• Membership
Virtual LANs : VLANs
– What characteristic can be used by vendors to group stations in a
VLAN?
• Port numbers
– Vendors use switch port number as membership characteristic.
– Ex.: the administrator can define that stations connecting to ports 1, 2, 3, and 7 belongs
to VLAN1; stations connecting to port 4, 10, and 12 belong to VLAN2.
• MAC addresses
–Some vendors use the 48-bit MAC address as a membership characteristic.
–Ex.: the administrator can stipulate that stations having MAC addresses E21324A12334
and F2A123BCD341 belong to VLAN1.
• IP ports
– Some vendors use the 32-bit IP address as a membership
– Ex.: the administrator can stipulate that stations having IP addresses 181.34.23.67,
181.34.23.71, etc. belong to VLAN1.
• Multicast IP addresses
– Some vendors use the multicast IP address as a membership
• Combination
– Recently, the software available from some vendors allow all these characteristics to be
combined.
127
Virtual LANs : VLANs
• Configuration
– How are the stations grouped into different VLANs?
• Manual configuration
– Network administrator uses the VLAN software to manually assign the stations
into different VLANs at setup
 He types the port address or any other characteristic using the VLAN software.
– Later migration from one VLAN to another is also done manually.
• Automatic configuration
– The stations are automatically connected or disconnected from a VLAN using
criteria defined by the administrator.
 The project number could be defined by the administrator as the criterion for
being a member of a group.
 A users, who changes the group, is automatically migrated to a new VLAN.
• Semiautomatic configuration
– Is between a manual and automatic configurations.
 Usually, the initialization is done manually while the migration is done
automatically.
128
Virtual LANs : VLANs
• Communication between switches
– In a multiswitched backbone, each switch must know:
• Which station belongs to which VLAN
• And the membership of stations connected to other switches.
– Three methods for the communication between switches
• Table maintenance
– When a station sends a broadcast frame to its group member, the switch creates an entry in a
table and records station membership.
– Switches send their tables to one another periodically for updating.
• Frame tagging
– When a frame is traveling between switches, an extra header is added to the MAC frame to
define the destination VLAN.
– The frame tag is used by the receiving switches to determine the VLANs to be receiving the
broadcast message.
• Time Division Multiplexing (TDM)
– The connection (trunk) between switches is divided into timeshared channels.
– If the total number of VLANs in a backbone is 5, each trunk is divided into 5 channels.
– The traffic destined to VLAN1 travels in channel 1, the traffic destined to VLAN2 travels in
channel 2, etc.
– The receiving switch determines the destination VLAN by checking the channel from which
the frame arrived.
129
Virtual LANs : VLANs
• IEEE standard
– The standard 802.1Q defines the format for frame tagging.
– It also defines the format to be used in multiswitched backbones
and enables the use of multivendors equipments in VLANs.
– Most vendors have already accepted the standard.
• Advantages using VLANs
– Cost and time reduction
• Physical reconfiguration takes time and is costly.
– Creating virtual work groups
• Can reduce traffic if the multicast capability of IP was previously used.
– Security
• People belonging to the same group can send broadcast messages with the
guaranteed assurance that users in other groups will not receive these
messages.
130