04 Llc Mac Tiong 2011

download 04 Llc Mac Tiong 2011

of 121

Transcript of 04 Llc Mac Tiong 2011

  • 8/2/2019 04 Llc Mac Tiong 2011

    1/121

  • 8/2/2019 04 Llc Mac Tiong 2011

    2/121

    2

    Covered in TransmissionLine & Interface Design

    unit

  • 8/2/2019 04 Llc Mac Tiong 2011

    3/121

    Results from the losses in the transmissionmedium

    Guided media Signal strength decays exponentially

    May be expressed as a logarithmic power ratio

    3

    Power_ ratio_ in_ dB =10log P1

    P2

  • 8/2/2019 04 Llc Mac Tiong 2011

    4/121

    4

  • 8/2/2019 04 Llc Mac Tiong 2011

    5/121

    5

    Addition or subtraction of dB yields the system loss/gain between 2pointsdB level at point 4=(-9)+(14)+(-3)=+2dBdB is a ratio and gives no indication of absolute power levels

  • 8/2/2019 04 Llc Mac Tiong 2011

    6/121

    Delay effects Multipath propagation effects in wireless

    Skew in parallel ports or busses

    Signals consist of various frequency

    components Each propagate at different speeds in guided

    medium

    Results in phase shift at the receiver

    Intersymbol interference

    6

  • 8/2/2019 04 Llc Mac Tiong 2011

    7/121

  • 8/2/2019 04 Llc Mac Tiong 2011

    8/121

    Various noise and disturbances may causeerrors in interpreting the received signal Thermal noise

    Uniform distribution across the frequency spectrum

    White noise Random errors

    Does not (normally) effect the following bit interval

    8

  • 8/2/2019 04 Llc Mac Tiong 2011

    9/1219

    Receiver must extract timing from theincoming signal

    Allows sampling when SNR is at maximum

    Maintain intersymbol spacing

    Indicates start/end of each timing interval

    Inclusion of error detecting/correcting

    Introduce additional bits into the raw data stream

    Channel line encoding

  • 8/2/2019 04 Llc Mac Tiong 2011

    10/12110

  • 8/2/2019 04 Llc Mac Tiong 2011

    11/12111

    Nyquist TheoremSample rate of at leasttwice the maximumfrequency component ofthe signal to bedigitisedAliasing occursQuantizing noise

  • 8/2/2019 04 Llc Mac Tiong 2011

    12/121

    12

    The end-to-end transfer of data from atransmitting application to a receivingapplication involves many steps

    Each subject to error.

    Errors can occur both at the bit and at the packetlevel.

    At the bit level, the most common error is bitcorruption

    At the packet level, we see errors such as packetloss, duplication, or reordering.

    Error control is the process of detecting and

    correcting both bit and packet errors.

  • 8/2/2019 04 Llc Mac Tiong 2011

    13/121

    13

    Bit-level error control usually involves addingredundancy to the transmitted data.

    In some schemes, there is sufficient information for

    the receiver not only to detect errors, but also to

    correct most of them.

    At the packet level, we assume that bit-level errorcontrol can detect all bit errors.

    (Detectable but uncorrectable bit errors are treated

    as a packet loss.)

  • 8/2/2019 04 Llc Mac Tiong 2011

    14/121

    14

    Packet-level error control mechanisms detectand correct packet-level errors such as loss,duplication, and reordering.

    We typically implement bit-level error controlat the datalink layer of the protocol stack.

    Packet-level error control is typically found atthe transport layer.

    Thus, bit level error control is usually hop-by-hop,whereas packet-level error control is usually end-to-

    end.

  • 8/2/2019 04 Llc Mac Tiong 2011

    15/121

    15

    Generally speaking, we prefer hop-by-hoperror control on links where the error rate ishigh (so-called lossy links) and end-to-enderror control when entire path is more or less

    error free.

  • 8/2/2019 04 Llc Mac Tiong 2011

    16/121

    16

    Information is transmitted on a link byvarying the state of a signal.

    On a digital link, each signal statecorresponds to one or more 0's and 1's-asignal that can take 2n, states represents nbits of information. To decipher a signal on adigital link, the receiver compares the

    received signal with a set of predefinedreferences.

  • 8/2/2019 04 Llc Mac Tiong 2011

    17/121

    We usually measure the error probability on adigital link in terms of the bit error rate orBER the ratio of the mean number of errors in any given

    interval to the total number of bits transmitted inthat interval.

    Typical fiber-optic links have a bit error ratio in therange of 10-18- 10-14, but copper links can have a

    substantially higher bit error ratio, depending onshielding and the operating environment.

    17

  • 8/2/2019 04 Llc Mac Tiong 2011

    18/121

    18

    The major causes of bit errors are Gaussianand non-Gaussian noise, loss of linesynchronisation, scramblers, protectionswitching, and, for cellular communication,

    handoffs and fading

  • 8/2/2019 04 Llc Mac Tiong 2011

    19/121

    Gaussian noise

    A common assumption is that the noise amplitude is

    described by a Gaussian (normal) distribution. We call

    such noise Gaussian noise. Gaussian noise on a line

    leads to uncorrelated and sporadic bit errors.

    Non-Gaussian noise

    Non-Gaussian noise, which refers to noise that does not

    obey a Gaussian distribution, can lead to bursts of

    errors. Common sources of non-Gaussian noise are

    electrical impulses, such as lightning or electrical sparks.

    19

  • 8/2/2019 04 Llc Mac Tiong 2011

    20/121

    A third source of bit errors is loss of bitsynchronisation between the transmitter andthe receiver.

    Receivers periodically sample the receivedanalog waveform to extract digitalinformation.

    They typically use the transitions in the

    transmitter's signal as the input to a phase-locked loop to determine the transmitter'sclock automatically.

    20

  • 8/2/2019 04 Llc Mac Tiong 2011

    21/121

    Handoffs and fading can cause error bursts incellular communication.

    A mobile unit is switched from one base station

    to another. It is common for some information

    from the mobile unit to be lost in this process.

    Although voice callers may not notice this, data

    sources (such as modems) can be badly hit.

    Typical handoffs last for about 150 ms during whichtime the received signal is almost completely in error.

    21

  • 8/2/2019 04 Llc Mac Tiong 2011

    22/121

    Handoff errors can be substantially reducedby making the new connection before the oldone ends. However, this makes it necessary to overlap base-

    station ranges, which leads to less efficient spatialreuse of the radio spectrum.

    22

  • 8/2/2019 04 Llc Mac Tiong 2011

    23/121

    If a mobile station does not receive a strongsignal from a base station because of hills,

    buildings, or other obstacles, then its

    received signal is in error until the unit movesaway from the obstacle.

    We call this loss of signal strength fading, and it

    causes long burst errors. There are two types of

    fading: shadow fading, which is due to macroscopicenvironmental conditions, and short-term Rayleigh

    fading, primarily due to vehicle movement.

    23

  • 8/2/2019 04 Llc Mac Tiong 2011

    24/121

    Two important functions Flow control

    Error control

    Communication systems have limitations

    Speed at which they process incoming data Buffer space

    Flow control enables the receiver to regulate dataflow Invokes a control procedure known as an acknowledgement

    (ACK) Two common methods

    Stop and wait

    Sliding window

    24

  • 8/2/2019 04 Llc Mac Tiong 2011

    25/121

    Simple

    Inefficient

    Sender sends a frame and waits for an ACK

    Must wait at least 2tprop plus tf (time toprocess the incoming frame)

    No out of order frames

    25

  • 8/2/2019 04 Llc Mac Tiong 2011

    26/121

    26

  • 8/2/2019 04 Llc Mac Tiong 2011

    27/121

    27

    May transmit several frames without receivingACK

    A single ACK may acknowledge many frames

    Utilises an identification scheme based on thesize of the window

    Numbered modulo n, where n=window size-1

    ACK is usually sent prior to window size

    reducing to zero

  • 8/2/2019 04 Llc Mac Tiong 2011

    28/121

    28

    Refers to the method used to detect andcorrect errors that occur in the transmissionof frames

    Retransmission of errored or dropped frames

    Utilises ACK and NACK

    Automatic Repeat Request (ARQ)

    Three types

    Stop and WaitGo-back N

    Selective repeat

  • 8/2/2019 04 Llc Mac Tiong 2011

    29/121

    29

    Basically stop and wait flow control Extended to include NACK

    Source sends a single frame

    Waits for an ACK or NACK Timer counts down 2

    tpropplus t

    f

    Very inefficient

  • 8/2/2019 04 Llc Mac Tiong 2011

    30/121

    30

    Based on sliding window AKA continuous ARQ

    N specifies how many frames may be sent withoutan ACK or NACK

    Receiver discards all incoming frames after anerror Waits to receive correctly the errored frame Sender must retransmit all frames after the one in

    error, hence go back N

    Also includes a timer More efficient and requires no re-ordering at the

    receiver

  • 8/2/2019 04 Llc Mac Tiong 2011

    31/121

    31

    Only lost or damaged frames retransmitted More efficient

    From the utilisation viewpoint

    Complex implementation Re-ordering of retransmitted frames

    Not often used

  • 8/2/2019 04 Llc Mac Tiong 2011

    32/121

    32

  • 8/2/2019 04 Llc Mac Tiong 2011

    33/121

    33

  • 8/2/2019 04 Llc Mac Tiong 2011

    34/121

    34

    Synchronous bit pipe Sending side of DLC supplies the sending side modem bits at a fixed

    rate (one bit per T seconds)

    Idle fill (dummy bits) when no data

    Intermittent Synchronous bit pipe

    Supplies synchronously when there is data to be sent

    Sends nothing when no data

    Receiver complications:

    need to distinguish between 0, 1 and idle

    Re-synchronize with sender at end of idle period

    Asynchronous character pipe

    Bits within a character sent at a fixed rate

    Characters separated by variable delays

  • 8/2/2019 04 Llc Mac Tiong 2011

    35/121

    35

    In asynch serial communication, the electrical interface is held in the mark position betweencharacters. The start of transmission of a character is signaled by a drop in signal level to the spacelevel. At this point, the receiver starts its clock. After one bit time (the start bit) come 7 or 8 bits oftrue data followed by one or more stop bits at the mark level. The receiver tries tosample the signal in the middle of each bit time. The byte will be read correctly if the line is still inthe intended state when the last stop bit is read.

  • 8/2/2019 04 Llc Mac Tiong 2011

    36/121

    We need to decide where a frame starts andends

    Character based framing Uses special characters

    SYN for idle and fill STX Start transmission

    ETX End Transmission

    Bit Oriented Framing Special string of bits 01111110

    Start, end and fill

    Length count Gives the frame length in a header field

    36

  • 8/2/2019 04 Llc Mac Tiong 2011

    37/121

    Frames consist of integer number of bytes Asynchronous transmission systems using ASCII to transmit printable

    characters

    Octets with HEX value

  • 8/2/2019 04 Llc Mac Tiong 2011

    38/121

    When sending arbitrary data (not characters)control characters may appear in frame SOLUTION: Transparent Mode: Introduce DLE

    Start of text: DLE STX, End of text: DLE ETX

    If DLE appears in packet? Use DLE DLE (receiver strips first DLE of pair)

    38

    Data to be sent

    A DLE B ETX DLE STX E

    After stuffing and framing

    DLE DLE B ETX DLE DLE STXDLE STX A E DLE ETX

  • 8/2/2019 04 Llc Mac Tiong 2011

    39/121

    39

    Errors in header and packet caught by CRC Errors in DLE STX and DLE ETX

    An entire frame is missing

    Errors could causeDLE ETX

    to appear inmiddle of frame Receiver interprets the bits following as CRC

    So it would be dropped

  • 8/2/2019 04 Llc Mac Tiong 2011

    40/121

    Frame delineated by flag character

    HDLC uses bit stuffingto prevent occurrence of flag01111110 inside the frame

    Transmitter inserts extra 0 after each consecutive five1s insidethe frame

    Receiver checks for five consecutive 1s if next bit = 0, it is removed

    if next two bits are 10, then flag is detected

    If next two bits are 11, then frame has errors

    Flag FlagAddress Control Information FCS

    HDLC frame

    any number of bits

  • 8/2/2019 04 Llc Mac Tiong 2011

    41/121

    0110111111111100

    Data to be sent

    After stuffing and framing

    0111111001101111101111100001111110

    (a)

    *000111011111-11111-110*

    Data received

    After destuffing and deframing

    01111110000111011111011111011001111110

    (b)

  • 8/2/2019 04 Llc Mac Tiong 2011

    42/121

    42

    DLL Protocols are sets of specifications usedto implement DLL.

    Contain rules for line discipline, flow control,error handling, etc.

    DLL Protocols comes in two broadgroups:

    Asynchronous (treat each character in a bitstream independently)

    Synchronous (takes the whole bit stream andchop it into characters of equal sizes)

  • 8/2/2019 04 Llc Mac Tiong 2011

    43/121

    43

    Developed over the last several decades XMODEM, YMODEM, ZMODEM, BLAST, Kermit

    and Others

    Used mainly in modems.

    Due to its inherent slowness (stemming from

    required addition of start and stop bits and

    extended spaces between frames) asynchronous

    transmissions at this level is being replaced byhigher speed synchronous mechanisms.

  • 8/2/2019 04 Llc Mac Tiong 2011

    44/121

    Designed in 1979 by Ward Christiansen file transfer protocol for telephone line

    communications between PCs.

    Half duplex stop and wait ARQ protocol

    44

  • 8/2/2019 04 Llc Mac Tiong 2011

    45/121

    The 1st field is a one-Byte SOH (Start ofHeader).

    The 2nd field is a 2-byte header. The first header byte is SN.

    The second header byte is used to check thevalidity of the SN.

    The fixed data field holds 128 Bytes (binary,ASCII etc).

    The last field, CRC, checks for errors in datafield only.

    45

  • 8/2/2019 04 Llc Mac Tiong 2011

    46/121

    Transmission begins with sending of a NAK fromreceiver to sender.

    Each time the sender sends a frame, it must waitfor an ACK before next frame is sent again.

    A frame can also be resent if a response is notreceived by the sender after a specified amountof time.

    Besides a NAK or an ACK, the sender can receive

    a cancel signal (CAN), which aborts transmission. Slow but reliable

    Necessary at that time

    46

  • 8/2/2019 04 Llc Mac Tiong 2011

    47/121

    47

    This is similar to XMODEM, with followingmajor differences:

    Data unit is 1024 bytes

    Two CANs are sent to abort transmission

    ITU-T CRC-16 is used for error checking

    Multiple files can be sent simultaneously

  • 8/2/2019 04 Llc Mac Tiong 2011

    48/121

    48

    Zmodem is a newer protocol Combines Xmodem & Ymodem features

    BLAST Full duplex

    Sliding window flow control

  • 8/2/2019 04 Llc Mac Tiong 2011

    49/121

    Currently the most widely used asynchronousprotocol. Similar in operation to XMODEM

    sender waiting for a NAK before starts transmission.

    Allows the transmission of control characters astext using two steps.

    The control character is transformed to a printablecharacter by adding a fixed number to its ASCII coderepresentation.

    The # character is added to the front of thetransformed character.

    a control character is sent as two characters.

    49

  • 8/2/2019 04 Llc Mac Tiong 2011

    50/121

    When the receiver encounters a # character it knows that this must be dropped and that the

    next character is a control character.

    If sender wants to send a # character, it will send

    two of them. Note that Kermit is a terminal emulation

    program as well as a file transfer protocol.

    50

  • 8/2/2019 04 Llc Mac Tiong 2011

    51/121

    There are two broad categories of synchronousprotocols:

    Character Oriented

    interpret a transmission frame as a succession of characters,

    each usually composed of one octet (8 bits). All controlinformation is in the form of an existing character encoding

    system (e.g. ASCII characters).

    Bit Oriented

    interpret a transmission frame of packet as a succession of

    individual bits made meaningful by their placement of theframe. Control information in a bit oriented protocol can be

    one or multiple bits.

    51

  • 8/2/2019 04 Llc Mac Tiong 2011

    52/121

    Not as efficient as bit oriented protocols seldom used.

    easy to comprehend and employ the same logic andorganization as the bit oriented protocols.

    In all DLL protocols, control information isinserted into the data stream either as separatecontrol frames or as additions to existing dataframes. In character oriented protocols this information is in the

    form of code words taken from existing character sets

    The best known is IBMs binary synchronouscommunications (BSC)

    52

  • 8/2/2019 04 Llc Mac Tiong 2011

    53/121

    53

  • 8/2/2019 04 Llc Mac Tiong 2011

    54/121

    Usable in both Point to point and multi pointconfigurations Supports half duplex transmissions using stop and wait

    ARQ flow control and error correction.

    BSC protocol divides transmission into frames.

    Two types, Data and Control.

    Data frames are used to transmit information but maycontain control information applicable to thatinformation.

    Control frames are used to exchange informationbetween communicating devices. (e.g. establish initialconnection, control the flow of the transmission, requesterror corrections, disconnect the devices).

    54

  • 8/2/2019 04 Llc Mac Tiong 2011

    55/121

    SYN is used by the receiving device tosynchronize its timing with the sendingdevice.

    STX tells the user that the next byte starts the

    data (variable length) until ETX is reached.

    55

  • 8/2/2019 04 Llc Mac Tiong 2011

    56/121

    Problems Require addresses

    SN, at least 0 or 1 for stop and wait

    The probability of error in the block of text

    increases with the length of the block. a message is often divided between several blocks.

    Each block except the last one, starts with an STX andends with an ITB (Intermediate Text Block).

    The last block starts with an STX and ends with an ETX.

    Immediately after an ITB or ETX there is a BCC field.

    If a retransmission is required, the entire frame isrequired to be transmitted.

    56

  • 8/2/2019 04 Llc Mac Tiong 2011

    57/121

    Entire message in one frame Several frames can carry continuations of a single

    message.

    The ETX in all frames but the last is replaced by ETB

    (End of Transmission Block). The receiver will acknowledge each frame separately but

    cannot take control of the link until it receives the ETX

    57

  • 8/2/2019 04 Llc Mac Tiong 2011

    58/121

    Control frames are not control characters. They are used to send commands to or solicit

    information from another device.

    Such a frame contains no data but it carries informationspecific to the function of the DLL itself.

    Control frames serves in establishing connections,maintaining flow, and error control during datatransmission and terminating connections.

    BSC was originally designed to transport textual

    messages a user is just as likely to send binary sequences that

    contain non textual information and commands.

    58

  • 8/2/2019 04 Llc Mac Tiong 2011

    59/121

    Byte oriented protocols bits are grouped into predefined patterns (characters)

    Bit-oriented protocols

    more information into shorter frames

    Avoid the transparency problems of character oriented

    protocols.

    Broadly categorized into

    SDLC (Synchronous Data Link Control) HDLC (High-level Data Link Control)

    LAPs (Link Access Protocols)

    59

  • 8/2/2019 04 Llc Mac Tiong 2011

    60/121

    In 1975 IBM pioneered development of SDLC and lobbied ISOto make SDLC the standard.

    In 1979, ISO answered with HDLC, which was based on SDLC.

    Adoption of HDLC by ISO led to its adoption and extension by

    other organizations.

    ITU-T was one the first organizations that embraced HDLC.

    LAPs (LAPB, LAPD, LAPX, etc), all based on HDLC.

    Other protocols such as Frame relay and PPP developed both by

    ITU-T and ANSI also derive from HDLC, as do most LAN access

    control protocols.

    In short all bit oriented protocols in use today either derive from

    or are sources for HDLC.

    Thus, through HDLC we can obtain a basic understanding for

    others.

    60

  • 8/2/2019 04 Llc Mac Tiong 2011

    61/121

    HDLC (ISO 3009, ISO 4335) is a bit oriented DLLprotocol designed to support both half duplex and

    full duplex communication over point to point and

    multi-point links.

    Systems using HDLC can be characterized by theirstation types, configurations and their response

    modes.

    61

  • 8/2/2019 04 Llc Mac Tiong 2011

    62/121

    HDLC differentiate between three types of stations: Primary:

    This has complete control of the links in point to point and

    multi point line configurations. Frames issued by primary are

    called commands

    Secondary:

    Primary issues commands to secondary and secondary sends

    responses. Primary maintains a separate logical link with each

    secondary station on the line.

    Combined:

    This can both command and respond and behaves either as a

    primary or as a secondary depending on the nature and

    direction of the transmission.

    62

  • 8/2/2019 04 Llc Mac Tiong 2011

    63/121

    Primary, Secondary and Combined can be connectedin three different configurations supporting half and

    full duplex.

    Unbalanced configuration

    also called master-slave is one in which one device is the primary

    and the others are secondary.

    These can be point to point but more often they are multipoint,

    with one primary controlling several secondaries.

    63

  • 8/2/2019 04 Llc Mac Tiong 2011

    64/121

    Symmetrical configuration is one in which each physical

    station on a link consists of two logical stations (one a primary

    and the other a secondary)

    Separate lines link the primary aspect of one physical station to the

    secondary aspect of another physical station. A symmetrical

    configuration behaves like an unbalanced configuration except that

    control of the link can shift between the two stations.

    Balanced configuration is one in which both stations

    in a point to point topology are of combined type.

    The stations are linked by a single line that can be

    controlled by either station.

    64

  • 8/2/2019 04 Llc Mac Tiong 2011

    65/121

    65

  • 8/2/2019 04 Llc Mac Tiong 2011

    66/121

    HDLC has three modes of data transfer: NRM (Normal Response Mode)

    Used in unbalanced configurations. The primary may initiatedata transfer to secondary. But a secondary may transmit only inresponse to a command.

    ARM (Asynchronous Response Mode) A secondary may initiate a transmission without permission

    from primary whenever channel is idle. All transmission fromsecondary (even to another secondary on same link) must stillbe relayed through primary.

    ABM (Asynchronous Balanced Mode)

    All stations are equal and therefore only combined stationsconnected in point to point are used. Either combined stationmay initiate transmission with the other combined stationwithout permission.

    66

  • 8/2/2019 04 Llc Mac Tiong 2011

    67/121

    HDLC defines three types of frames Information frames (I-frames)

    used to transport user data and related control

    Supervisory frames (S-frames)

    used only to transport control

    Unnumbered frames (U-frames)

    reserved for system management (managing the link)

    67

  • 8/2/2019 04 Llc Mac Tiong 2011

    68/121

    68

  • 8/2/2019 04 Llc Mac Tiong 2011

    69/121

    The flag field is an 8-bit sequence

    01111110

    The second field is the address field.

    Contains the address of the secondary station is to receive

    the frame. Not needed for point to point links; however, it is always

    included for uniformity. (PPP)

    The address field can be one or several bytes long.

    If address field is several bytes, all bytes but the last one

    will end with a 0 only the last will end with a 1. Ending the

    intermediate byte with a 0 indicates to the receiver that

    more address bytes exist.

    69

  • 8/2/2019 04 Llc Mac Tiong 2011

    70/121

    Control field One or two byte segment of frame used for flow

    management.

    If the first bit of the control field is a 0 the frame

    is an I-frame.

    If the 1st two bits are 10 then it is a S-frame.

    If both 1st and 2nd bits are 1 then it is a U-frame.

    The control fields of all three types offrames contain a bit called poll/final (P/F)

    bit.

    70

  • 8/2/2019 04 Llc Mac Tiong 2011

    71/121

    An I-frame contains 3-bit flow and error controlsequences

    N(S) (for SN)

    N(R ) (for RN) flanking P/F bits.

    Thus, N(R ) is the acknowledgement field. The control field of an S-frame contains an N(R)

    field but not an N(S) field.

    S-frames do not transmit data and hence do not require

    N(S). The two bits preceding P/F bits in an S-frame are usedto carry coded flow and error control information.

    71

  • 8/2/2019 04 Llc Mac Tiong 2011

    72/121

    U-frames have neither N(S) nor N(R) fieldsand are not designed for user data exchangeor acknowledgement. U-frames have two code fields

    one 2-bits and the other 3-bits flanking the P/F bit. These codes are used to identify the type of U-frame

    and its function.

    72

  • 8/2/2019 04 Llc Mac Tiong 2011

    73/121

    73

  • 8/2/2019 04 Llc Mac Tiong 2011

    74/121

    74

  • 8/2/2019 04 Llc Mac Tiong 2011

    75/121

    75

  • 8/2/2019 04 Llc Mac Tiong 2011

    76/121

    The P/F field is a single bit with a dualpurpose.

    It has meaning only when it is set and can mean

    poll or final.

    It means poll when the frame is sent by primarystation to secondary

    It means final when frame is sent by secondary to a

    primary.

    76

  • 8/2/2019 04 Llc Mac Tiong 2011

    77/121

    Information field is present only in I-frames and U-frames The field can contain any sequence of bits but must

    consist an integral number of octets.

    The length of the information field is a variable up to some

    system defined maximum.

    FCS (Frame Check Sequence) field is an error detecting

    code calculated from the remaining bits of the frame

    (exclusive of flags).

    The normal code is the 16 bit CRC-CCITT.

    An optional 32-bit FCS using CRC-32 may be employed if the

    frame length or the line reliability dictates this choice.

    77

  • 8/2/2019 04 Llc Mac Tiong 2011

    78/121

    HDLC operation consists of exchange of I-frames, and some U-frames.

    Operation of HDLC involves three phases.

    First one side or another initializes the Data Link so that

    frames may be exchanged in an orderly fashion. During this phase, the options that are to be used are agreed

    upon.

    Then the two sides exchange user data and the control

    information to exercise flow and error control. Finally, one of the two sides will signal termination of

    operation.

    78

  • 8/2/2019 04 Llc Mac Tiong 2011

    79/121

    Initialization: This may be requested by either side.

    Initialization procedure signals the other side that

    initialization is requested and specifies which of the

    three mode (NRM, ARM, ABM) is requested and whether3 or 7 bit sequence numbers are to be used.

    If the other side accepts then the HDLC Module at that

    end will send an UA (unnumbered acknowledgement)

    frame back to initiating side.

    If request is rejected then DM (Disconnected Mode)

    frame is sent.

    79

  • 8/2/2019 04 Llc Mac Tiong 2011

    80/121

    Data Transfer: Once initialization has taken place a logical connection is

    established.

    Both sides may begin to send user data in I-frames

    SNs will be either modulo 8 or modulo 128 depending on

    whether 3 or 7 bit sequences are used. RR (received ready) frame is used when there is no reverse

    user data to carry acknowledgement.

    RNR (Receiver Not Ready) acknowledges I-frames askingthe peer entity to suspend transmission of I-frames.

    REJ (Reject) indicates the Go Back n ARQ. SREJ (Selective Reject) is used to request retransmission of a

    single frame.

    80

  • 8/2/2019 04 Llc Mac Tiong 2011

    81/121

    Disconnect: Either HDLC module can initiate a disconnect.

    HDLC issues a disconnect by replying with a DISC(disconnect) frame.

    81

  • 8/2/2019 04 Llc Mac Tiong 2011

    82/121

    82

  • 8/2/2019 04 Llc Mac Tiong 2011

    83/121

    83

  • 8/2/2019 04 Llc Mac Tiong 2011

    84/121

    84

  • 8/2/2019 04 Llc Mac Tiong 2011

    85/121

    Several protocols under the general category of LAPhave been developed. Each of these is a subset of HDLC tailored for a specific

    purpose.

    LAPB: Link Access Procedure Balanced is used only for connecting

    a station to a network and is a subset of HDLC thatprovides only the ABM.

    LAPB was issued by ITU-T as part of x.25 packet switchingnetwork interface standard. Its frame format is same as

    HDLC Thus it provides only the functions required for communication

    between a DTE and DCE.

    85

  • 8/2/2019 04 Llc Mac Tiong 2011

    86/121

    LAPD: Link Access Procedure D channel is another simplified subset of

    HDLC issued by ITU-T as part of its recommendation on ISDN.

    LAPD provides DLC over channel D.

    There are several key differences between LABD and HDLC.

    LAPD is restricted to ABM and always use 7-bit SN. The FCS of LAPD is always 16 bit CRC.

    The address field of LAPD is a 16 bit field that actually contains

    two sub addresses.

    LAPM:

    Link Access Procedure for Modems is designed to do

    asynchronoussynchronous conversion, error detection, and

    retransmission.

    86

  • 8/2/2019 04 Llc Mac Tiong 2011

    87/121

    LLC: Logical Link Control is a part of IEEE 802 family of

    standards for controlling operation over a LAN.

    LLC is lacking some features found in HDLC and

    also has some features not found in HDLC. The most obvious difference is in the frame format.

    Link control functions in the case of LLC are divided

    between two layers:

    A MAC and the LLC layer.

    87

  • 8/2/2019 04 Llc Mac Tiong 2011

    88/121

    88

  • 8/2/2019 04 Llc Mac Tiong 2011

    89/121

    The previous shows the structure of the combined MAC/LLC frame.

    Shaded portion corresponds to fields produced by LLC.

    The rest are added by the MAC.

    Two addresses are required since there is no concept of primary and

    secondary.

    Error detection is done at the MAC layer by 32-bit CRC.

    At the LLC layer there are the destination and source services Access

    Points (DSAP and SSAP) identifying the logical user of LLC at thesource and destination systems.

    LLC control field has the same format as the HDLC limited to 7 bit

    SNs.

    Operationally LLC offered three forms of services.

    The connection-oriented mode service is the same as ABM of HDLC.

    The other two services, unacknowledged connectionless and

    acknowledged connectionless.

    89

  • 8/2/2019 04 Llc Mac Tiong 2011

    90/121

    A LAN is a community of users who share theirinterconnecting medium

    The Media Access Control (MAC) protocol

    handles this function

    Two basic types of LAN

    Broadcast

    All users receive transmitted information

    Random access and controlled access contention methods Switched

    Employs forwarding logic and switching tables

    90

  • 8/2/2019 04 Llc Mac Tiong 2011

    91/121

    Usually average packet delay vs throughput Based on a queuing model

    Node is represented by a single server queue

    Node has a single buffer

    Packets of length Lp arrive and queue up to be processed

    Packets arrive according to Poisson distribution Not true - traffic is bursty, therefore a self similar distribution should be

    used

    The probability Pn(t) of exactly n packets arriving during time interval t is

    given by

    Where is the average packet arrival rate

    91

    Pn t( ) =e

    - l t l t( )n!

    n

  • 8/2/2019 04 Llc Mac Tiong 2011

    92/121

    92

  • 8/2/2019 04 Llc Mac Tiong 2011

    93/121

    Throughput S is the measure of successful traffic S often shown as normalised

    Lp=packet length

    R= Transmission rate

    Throughput is expressed in terms of offered load G Normalised offered load is

    Max throughput (capacity) is found by maximising S WRT G

    Latency is the time lapse between the generation ofthe first bit and the receipt of the last bit at thedestination

    93

    S=l L

    P

    R

    G =lTL

    P

    R

  • 8/2/2019 04 Llc Mac Tiong 2011

    94/121

    Queuing delay As the traffic increases packets have to wait longer

    before they can be sent

    Transmission delay

    Packet transmission time Tf is the time it takes totransmit a unit of data Tf=Lp/R

    Propagation delay Dependant on the media

    3x108

    m/s in space 2.3x108 m/s in copper

    2x108 m/s in optical fibre

    94

  • 8/2/2019 04 Llc Mac Tiong 2011

    95/121

    Stations contend for time on the network No control mechanisms

    Aloha

    Any station transmits whenever they have data

    Maximum of 18% efficient (Proof to follow)

    Slotted Aloha

    Same as Aloha with the addition of time slots

    Each slot is the same length as Tf Transmission may only occur at the start of a slot

    No partial overlapping of packets

    Doubles the efficiency of pure Aloha to about 37%

    95

  • 8/2/2019 04 Llc Mac Tiong 2011

    96/121

    CSMA- an improvement Carrier Sense Multiple Access

    Multiple Access, obvious

    Carrier Sense

    Listen to the media and transmit only if no transmission is

    already taking place CSMA/CD

    Adds in collision detection

    Listens to the channel

    If a collision is detected, send a jamming signal and cease

    transmission Wait a random amount of time before attempting to

    retransmit

    96

  • 8/2/2019 04 Llc Mac Tiong 2011

    97/121

    CSMA/CA (802.11) Collision avoidance

    Details in the wireless unit

    CDMA (Mobile comms)

    Code division multiple access

    May cover this briefly

    Frequency hopping

    Direct sequence

    97

  • 8/2/2019 04 Llc Mac Tiong 2011

    98/121

    98

  • 8/2/2019 04 Llc Mac Tiong 2011

    99/121

    99

  • 8/2/2019 04 Llc Mac Tiong 2011

    100/121

    Transmit and wait (2Tprop) for an acknowledgement Drops packets after K attempts

    Assuming

    All packets are the same length

    Each requires tp (slot) for transmission

    Vulnerable period = 2tp

    S=Throughput, G=offered traffic

    Assume the probability pk of k transmissions follows a

    Poisson distribution then

    100

    pk =Gke- G

    k!

    S is just the offered load times

    psuccess

    or p0

    S=Gp0

  • 8/2/2019 04 Llc Mac Tiong 2011

    101/121

    Where p0, probability that no packet isgenerated in 2tp

    P0=e-2G so that S=Ge-2G

    The maximum value of S occurs at G=0.5

    where S=1/2e or 0.184

    Thus the maximum throughput of pure aloha

    is 18%

    101

  • 8/2/2019 04 Llc Mac Tiong 2011

    102/121

    All users are synchronised to time slots Vulnerable period is now tp p0 =e

    -G which leads to

    S=Ge-G

    Maximum throughput is where G=1 so

    S=1/e=0.368 twice that of pure aloha

    102

  • 8/2/2019 04 Llc Mac Tiong 2011

    103/121

    103

  • 8/2/2019 04 Llc Mac Tiong 2011

    104/121

    Three possibilities when channel is sensed idle

    104

    CSMA Protocol Characteristics

    NonpersistentIf medium is idle - transmit

    If busy, wait a random time and re-sense channel

    1-PersistentIf medium is idle - transmit

    If busy-continue listening, transmit once idle

    p-PersistentIf medium is idle - transmit with probability p

    Listen until channel idle, transmit with probability p

  • 8/2/2019 04 Llc Mac Tiong 2011

    105/121

    S is expressed in terms of G and a a is a Non dimensional parameter

    105

    a = propagation_ delaypacket_ transmission _ time

    This equates to the vulnerable period

  • 8/2/2019 04 Llc Mac Tiong 2011

    106/121

    106

  • 8/2/2019 04 Llc Mac Tiong 2011

    107/121

    Scaling to tp, At t=0,channel is sensed idle Takes time a for all other stations to be aware of

    transmission

    So if no other transmission in time a, we have success

    Busy period for the channel is 1+a which is the

    propagation delay+transmission time

    Busy period is followed by an idle, thus a cycle is

    busy+idle time

    107

  • 8/2/2019 04 Llc Mac Tiong 2011

    108/121

    108

  • 8/2/2019 04 Llc Mac Tiong 2011

    109/121

    Ethernet/ 802.3 uses a deference mechanism Even if no packet waiting, station monitors the

    media

    When a packet is available and channel idle

    Packet transmitted if non-persistent or 1-persistent

    P-persistent, packet is sent with probability p or is

    delayed by the propagation delay

    109

  • 8/2/2019 04 Llc Mac Tiong 2011

    110/121

    If busy The packet is backed off and the algorithm is repeated

    (for non-persistent)

    Station defers until channel idle and immediately

    transmits for 1-persistent The p-persistent, the station defers until the channel

    is idle then follows the channel idle procedure

    MAC layer adds inter frame spacing

    110

  • 8/2/2019 04 Llc Mac Tiong 2011

    111/121

    Collisions may still occur In that case, station aborts transmission

    Sends jamming signal of duration b

    Dimensionless, analogous to a

    Stations involved in collisions wait a random timeprior to attempting re-transmission

    Ethernet uses truncated binary exponential backoff

    Transmission retries continue until success or 16

    attempts are made Packet is then discarded

    111

  • 8/2/2019 04 Llc Mac Tiong 2011

    112/121

    Packet unsuccessfully sent n times Next transmission attempt is delayed r times

    the base backoff

    Base backoff is usually twice the round trip

    propagation delay

    Uniformly distributed integer 0r2k

    Where k=min(n,10), k is the minimum number of

    presently attempted transmissions

    112

  • 8/2/2019 04 Llc Mac Tiong 2011

    113/121

    113

  • 8/2/2019 04 Llc Mac Tiong 2011

    114/121

    114

  • 8/2/2019 04 Llc Mac Tiong 2011

    115/121

    115

  • 8/2/2019 04 Llc Mac Tiong 2011

    116/121

    116Reprinted with permission from Takagi and Kleinrock,17 1987, IEEE

  • 8/2/2019 04 Llc Mac Tiong 2011

    117/121

    Deterministic Signals are used to grant permission to

    transmit

    No collisions

    Control may be centralized or distributed

    Polling is a centralized method

    117

  • 8/2/2019 04 Llc Mac Tiong 2011

    118/121

    118

  • 8/2/2019 04 Llc Mac Tiong 2011

    119/121

    Distributed (token) control Commonly ring topology, but may be bus

    Tokens are special bit patterns within packets

    Tokens continue to circulate even if there is notraffic to transmit

    Stations wishing to transmit, remove the token

    All stations are responsible for identifying andaccepting messages addressed to them

    Additionally they must forward all other messages

    Once a station has finished transmitting, it replacesthe token into circulation

    119

  • 8/2/2019 04 Llc Mac Tiong 2011

    120/121

    Eliminates collision detection timingrestrictions

    Micro segmentation

    Two major components in a switch

    Forwarding logic I/O ports

    IEEE 802.1 defines forwarding logic Examines incoming frame

    Transfers it to the correct port More details later

    120

  • 8/2/2019 04 Llc Mac Tiong 2011

    121/121