Computer Networks: 1.2 Network Hardware
Computer Networks: 1.2 Network Hardware
UNIT I: Introduction Network Hardware Software - Reference Models-Internet-ATM Physical layer-Transmission media - wireless transmission switching circuit switching! "acket switching! message switching# methods $ommunication Satellites
transmit whenever they want to& if two or more packets collide! each computer 'ust waits a random time and tries again later.
Aepeater
Aepeater
# second type of broadcast system is the ring. %n a ring! each bit propagates around on its own! not waiting for the rest of the packet to which it belongs. Typically! each bit circumnavigates the entire ring in the time it takes to transmit a few bits! often before the complete packet has even been transmitted. #s with all other broadcast systems! some rule is needed for arbitrating simultaneous accesses to the ring. ;arious methods! such as having the machines take turns! are in use. %*** 952.< ,the %B6 token ring-! is a ring-based 1#2 operating at = and 1> 6bps. ?//% is another e"ample of a ring network. *roadcast networks can %e further di+ided into static and dynamic ! depending on how the channel is allocated. # typical static allocation would be to divide time into discrete intervals and use a round-robin algorithm! allowing each machine to broadcast only when its time slot comes up. tatic allocation wastes channel capacity when a machine has nothing to say during its allocated slot! so most systems attempt to allocate the channel dynamically ,i.e.! on demand-. ,ynamic allocation methods for a common channel are either centrali-ed or decentrali-ed. %n the centrali.ed channel allocation method! there is a single entity! for e"ample! a bus arbitration unit! which determines who goes ne"t. %t might do this by accepting re0uests and making a decision according to some internal algorithm. %n the decentrali.ed channel allocation method! there is no central entity& each machine must decide for itself whether to transmit. @ou might think that this always leads to chaos! but it does not. 1ater we will study many algorithms designed to bring order out of the potential chaos.
MAN
1E
a
2 3 =
A
d
2ational network consists of regional subnetworks , , . 6etropolitan network # is part of regional subnetwork .
Wireless LANs
Figure 1-35. (a) Wireless networking with a base station. (b) Ad hoc networking.
*rror control is an important issue because physical communication circuits are not perfect. 6any error-detecting and error-correcting codes are known! but both ends of the connection must agree on which one is being used. The receiver must have some way of telling the senders which messages have been correctly received and which have not. #n issue that occurs at every level is how to keep a fast sender from swamping a slow receiver with data is called flow control& (hen there are multiple paths between source and destination! a route must be chosen. ometimes this decision must be split over two or more layers is called routing
Payload Ty e Indicator
The Payload Type %ndicator ,PT%- is a 3-bit field. %ts bits are used as follows:The first bit indicates the type of #T6 cell that follows. # first bit set to 5 indicates user data& a bit set to 1 indicates operations! administration H management ,)#H6- data. The second bit indicates whether the cell e"perienced congestion in its 'ourney from source to destination. This bit is also called the *"plicit ?orward :ongestion %ndication ,*?:%- bit. The second bit is set to 5 by the source& if an interim switch e"periences congestion while routing the cell! it sets the bit to 1. #fter it is set to 1! all other switches in the path leave this bit value at 1. /estination #T6 endpoints can use the *?:% bit to implement flow control mechanisms to throttle back on the transmission rate until cells with an *?:% bit set to 5 are received. The third bit indicates the last cell in a block for ##1< in user #T6 cells. ?or nonuser #T6 cells! the third bit is used for )#H6 functions.
tructure of an #T6 cell #n #T6 cell consists of a <-byte header and a =9-byte payload!#T6 defines two different cell formats: 22% ,2etwork-2etwork %nterface- and $2% ,$ser-2etwork %nterface-. 6ost #T6 links use $2% cell format.
/iagram of the $2% #T6 :ell L 7?: ;P% ;:% ;:% I*: PT :1P = 3 ;P% ;:% 5
/iagram of the 22% #T6 :ell L ;P% ;P% ;:% ;:% I*: PT :1P ;:% = 3 5
7?: M 7eneric ?low :ontrol ,= bits- ,default: =-.ero bits;P% M ;irtual Path %dentifier ,9 bits $2%- or ,12 bits 22%-
;:% M ;irtual channel identifier ,1> bitsPT M Payload Type ,3 bits:1P M :ell 1oss Priority ,1-bitI*: M Ieader *rror :ontrol ,9-bit :A:! polynomial M N9 O N2 O N O 1#T6 uses the PT field to designate various special kinds of cells for operations! administration! and maintenance ,)#6- purposes! and to delineate packet boundaries in some ##1s. everal of #T6+s link protocols use the I*: field to drive a :A:-Based ?raming algorithm! which allows locating the #T6 cells with no overhead re0uired beyond what is otherwise needed for header protection. The 9-bit :A: is used to correct single-bit header errors and detect multi-bit header errors. (hen multi-bit header errors are detected! the current and subse0uent cells are dropped until a cell with no header errors is found.
B-% /2 protocol model and architecture $ser plan: Physical layer! #T6 layer! ##1 ,1-<-! higher layers :ontrol plan: Physical layer! #T6 layer! ##1 , ##1-! higher layers 6anagement plan: layer management and plan management
Management "lane
egmentation and Aeassembly 7eneric ?low :ontrol :ell Ieader #T6 7eneration8*"traction :ell ;:%8;P% Translation :ell 6ultiple"ing8 /e-multiple"ing P Transmission :ell Aate /ecoupling I :onvergence ,T:- :ell /elineation @ Transmission ?rame #daption P6/ Bit Timing! Phy. 6edium
#A ub-layer
2.2 7uided Transmission 6edia The purpose of the physical layer is to transport a raw bit stream from one machine to another. ;arious physical media can be used for the actual transmission. *ach one has its own niche in terms of bandwidth! delay! cost! and ease of installation and maintenance.
(&(&. $oa8ial :able %t has better shielding than twisted pairs! so it can span longer distances at higher speeds. Two kinds of coa"ial cable are widely used. )ne kind! <5-ohm cable! is commonly used when it is intended for digital transmission from the start. The other kind! L<-ohm cable # coa"ial cable consists of a stiff copper wire as the core! surrounded by an insulating material. The insulator is encased by a cylindrical conductor! often as a closely-woven braided mesh. The outer conductor is covered in a protective plastic sheath.
The construction and shielding of the coa"ial cable give it a good combination of high bandwidth and e"cellent noise immunity. The bandwidth possible depends on the cable 0uality! length! and signal-to-noise ratio of the data signal. 6odern cables have a bandwidth of close to 1 7I.. :oa"ial cables used to be widely used within the telephone system for long-distance lines but have now largely been replaced by fiber optics on long-haul routes. :oa" is still widely used for cable television and metropolitan area networks.
But since any light ray incident on the boundary above the critical angle will be reflected internally! many different rays will be bouncing around at different angles. *ach ray is said to have a different mode! so a fiber having this property is called a multimode fiber. The fiber+s diameter is reduced to a few wavelengths of light! the fiber acts like a wave guide! and the light can propagate only in a straight line! without bouncing! yielding a single-mode fiber. ingle-mode fibers are more e"pensive but are widely used for longer distances. :urrently available single-mode fibers can transmit data at <5 7bps for 155 km without amplification. *ven higher data rates have been achieved in the laboratory for shorter distances.
# communication satellite can be thought of as a big microwave repeater in the sky. %t contains several transponders! each of which listens to some portion of the spectrum! amplifies the incoming signal! and then rebroadcasts it at another fre0uency to avoid
interference with the incoming signal. The downward beams can be broad! covering a substantial fraction of the earth+s surface! or narrow! covering an area only hundreds of kilometers in diameter. This mode of operation is known as a bent pipe.
Public witched Telephone ystem The properties of Telephones The 1ocal 1oop: 6odems! #/ 1 and (ireless Trunks and 6ultiple"ing witching
1ocal loops use analog signaling! but most intertoll trunks are rapidly being converted to digital transmission
Ma4or $om"onents of the Tele"hone System 1ocal loops #nalog twisted pairs going to houses and businesses
Trunks /igital fiber optics connecting the switching offices witching offices (here calls are moved from one trunk to another The 1ocal 1oop: 6odems! #/ 1! and (ireless
To transmit signals over the local loop! a continuous tone in the 1555 to 2555 I. range is used! called a sine wa+e carrier. There are three ways of modulating it ,to transmit information-: 1. Am"litude modulation: two different voltage levels are used to represent 5 and 1! respectively. 2. 0re;uency modulation: two ,or more- different tones are used. 3. Phase modulation: the carrier wave is systematically shifted certain degrees at uniformly spaced intervals. # modem ,modulator-demodulator- is a device which accepts a serial stream of bits as input and produces a modulated signal as output ,or vice versa-. %t is inserted between the digit computer and the analog telephone system. peed: up to <>4bps.
17
Trunks and multiple"ing Physical channels are very valuable! so it is worthwhile to multiple" many logical channels over a single physical channel. Two categories of multiple"ing schemes: 0,M 0re;uency ,i+ision Multi"le8ing#: the fre0uency spectrum is divided among the logical channels! with each user having e"clusive possession of his fre0uency band. T,M Time ,i+ision Multi"le8ing#: the users take turns ,in round robin-! each one periodically getting the entire bandwidth for a little burst of time. #n e"ample: #6 radio broadcasting system. The allocated spectrum is about 1 6I. ,roughly <55 kI. - 1<55 kI.-. The allocated spectrum is divided into different portions! each for one station ,?/6-. ome stations may have two logical subchannels: music and advertising. These two alternate in time on the same fre0uency ,T/6-. 0re;uency ,i+ision Multi"le8ing
?ilters limit the usable bandwidth to about 3555 I. per channel. Q Q Q =555 I. is allocated to each channel to avoid interference. :hannels are raised in fre0uency! each by a different amount. 1ogical channels are combined to transmit over one physical channel.
Time ,i+ision Multi"le8ing %n contrast to ?/6! which re0uires analog circuitry! T/6 can be handled entirely by digital electronics! so it has become far more widespread in recent years. T/6 is mostly used in interoffice trunks for digital data. #nalog signals from the local loops can be digiti.ed in the end office by a codec ,coder-decoder-! producing a L- or 9- bit number. The codec makes 9555 samples per second ,12< usec8sample- because this is sufficient to capture all the information from a =-kI. bandwidth. This techni0ue is called "cm "ulse code modulation ;irtually all time intervals within the telephone system are multiples of 12< usec.
Circuit Switchin$
:ircuit switching:
Packet switching.
%n circuit switching! each switching office has a number of incoming lines and outgoing lines. (hen a call passes through a switching office! a physical connection is established between incoming line and an outgoing line. Before any data can be sent! an end-to-end path needs to be set up. The setup time can easily be 15 sec or more. )nce the connection is set up! the only delay for data is the propagation 19 time for electromagnetic signal! about < msec per 1555 km! and there is no danger of congestion.
Message and Packet Switching 2o physical path is established in advance. *ach message or packet is sent to a switching office in its entirety! stored ,and check for errors- there and then forwarded later! one hop at a time.
a# $ircuit switching
%# Message switching
c# Packet switching
Message "witching
#n alternative switching strategy is message switching! illustrated in ?ig. 2-3P,b-. (hen this form of switching is used! no physical path is established in advance between sender and receiver. %nstead! when the sender has a block of data to be sent! it is stored in the first switching office ,i.e.! router- and then forwarded later! one hop at a time. *ach block is received in its entirety! inspected for errors! and then retransmitted. # network using this techni0ue is called a store-and-forward network.
#ac$et "witching
(ith message switching! there is no limit at all on block si.e! which means that routers ,in a modern system- must have disks to buffer long blocks. %t also means that a single block can tie up a router-router line for minutes! rendering message switching useless for interactive traffic. To get around these problems! packet switching was invented! Packet-switching networks place a tight upper limit on block si.e! allowing packets to be buffered in router main memory instead of on disk. By making sure that no user can monopoli.e any transmission line very long ,milliseconds-! packetswitching networks are well suited for handling interactive traffic. # further advantage of packet switching over message switching is shown in ?ig. 2-3P ,c-: the first packet of a multi packet message can be forwarded before the second one has fully arrived! reducing delay and improving throughput. ?or these reasons! computer networks are usually packet switched! occasionally circuit switched! but never message switched.
To accomplish these goals! the data link layer takes the packets it gets from the network layer and encapsulates them into frames for transmission. *ach frame contains a frame header! a payload field for holding the packet! and a frame trailer The function of the data link layer is to provide services to the network layer. The principal service is transferring data from the network layer on the source machine to the network layer on the destination machine. )n the source machine is an entity! call it a process! in the network layer that hands some bits to the data link layer for transmission to the destination. The 'ob of the data link layer is to transmit the bits to the destination machine so they can be handed over to the network layer
The data link layer can be designed to offer various services. The actual services offered can vary from system to system. Three reasonable possibilities that are commonly provided are
1. $nacknowledged connectionless service. 2. #cknowledged connectionless service. 3. #cknowledged connection-oriented service. 6nacknowledged $onnectionless ser+ice )osses are taken care of at higher layers 6sed on relia%le medium like coa8 ca%les or o"tical fi%er! where the error rate is low& A""ro"riate for +oice! where delay is worse than %ad data& $nacknowledged connectionless service consists of having the source machine send independent frames to the destination machine without having the destination machine acknowledge them. 2o logical connection is established beforehand or released afterward. %f a frame is lost due to noise on the line! no attempt is made to detect the loss or recover from it in the data link layer. This class of service is appropriate when the error rate is very low so that recovery is left to higher layers. %t is also appropriate for real-time traffic! such as voice! in which late data are worse than bad data. Acknowledged connectionless ser+ice& 6seful on unrelia%le medium like wireless& Acknowledgements add delays& Adding ack in the ,)) rather than in the N) is 4ust an o"timi-ation and not a re;uirement& )ea+ing it for the N) is inefficient as a large message "acket# has to %e resent in that case in contrast to small frames here& 5n relia%le channels! like fi%er! the o+erhead associated with the ack is not 4ustified&
(hen this service is offered! there are still no logical connections used! but each frame sent is individually acknowledged. %n this way! the sender knows whether a frame has arrived correctly. %f it has not arrived within a specified time interval! it can be sent again. This service is useful over unreliable channels! such as wireless systems.
9ach frame sent is indeed recei+ed 9ach frame is recei+ed e8actly once 0rames are recei+ed in order S"ecial care has to %e taken to ensure this in connectionless ser+ices
The most sophisticated service the data link layer can provide to the network layer is connection-oriented service. (ith this service! the source and destination machines establish a connection before any data are transferred. *ach frame sent over the connection is numbered! and the data link layer guarantees that each frame sent is indeed received. ?urthermore! it guarantees that each frame is received e"actly once and that all frames are received in the right order. (ith connectionless service! in contrast! it is conceivable that a lost acknowledgement causes a packet to be sent several times and thus received several times. :onnection-oriented service! in contrast! provides the network layer processes with the e0uivalent of a reliable bit stream. (hen connection-oriented service is used! transfers go through three distinct phases. %n the first phase! the connection is established by having both sides initiali.e variables and counters needed to keep track of which frames have been received and which ones have not. %n the second phase! one or more frames are actually transmitted. %n the third and final phase! the connection is released! freeing up the variables! buffers! and other resources used to maintain the connection. (hen a frame arrives at a router! the hardware checks it for errors ,using techni0ues we will study late in this chapter-! then passes the frame to the data link layer software ,which might be embedded in a chip on the network interface board-. The data link layer software checks to see if this is the frame e"pected! and if so! gives the packet contained in the payload field to the routing software. The routing software then chooses the appropriate outgoing line and passes the packet back down to the data link layer software! which then transmits it. The flow over two routers is shown in ?ig. 3-3.
0raming The usual approach is for the data link layer to break the bit stream up into discrete frames and compute the checksum for each frame. ,:hecksum algorithms will be discussed later in this chapter.- (hen a frame arrives at the destination! the checksum is recomputed. %f the newly-computed checksum is different from the one contained in the frame! the data link layer knows that an error has occurred and takes steps to deal with it ,e.g.! discarding the bad frame and possibly also sending back an error report-. Breaking the bit stream up into frames is more difficult than it at first appears. )ne way to achieve this framing is to insert time gaps between frames! much like the spaces between words in ordinary te"t. Iowever! networks rarely make any guarantees about timing! so it is possible these gaps might be s0uee.ed out or other gaps might be inserted during transmission.
$haracter $ount 0lag %ytes with %yte stuffing 0lag %ytes with %it stuffing
$haracter $ount The first framing method uses a field in the header to specify the number of characters in the frame. (hen the data link layer at the destination sees the character count! it knows how many characters follow and hence where the end of the frame is.
Figure -%. A character stream. &a' (ithout errors. &b' (ith one error.
Pro%lem with 0raming with $$ (hat if the count is garbled *ven if with checksum! the receiver knows that the frame is bad there is no way to tell where the ne"t frame starts. #sking for retransmission doesnRt help either because the start of the retransmitted frame is not known 2o longer used 0lag %ytes with %yte stuffing The second framing method gets around the problem of resynchroni.ation after an error by having each frame start and end with special bytes. %n the past! the starting and ending bytes were different! but in recent years most protocols have used the same byte! called a flag byte! as both the starting and ending delimiter. %n this way! if the receiver ever loses synchroni.ation! it can 'ust search for the flag byte to find the end of the current frame. Two consecutive flag bytes indicate the end of one frame and start of the ne"t one.
0igure .-<& a# A frame delimited %y flag %ytes& %# 0our e8am"les of %yte se;uences %efore and after %yte stuffing The byte-stuffing scheme depicted in ?ig. 3-< is a slight simplification of the one used in the PPP protocol that most home computers use to communicate with their %nternet service provider.
# ma'or disadvantage of using this framing method is that it is closely tied to the use of 9-bit characters. 2ot all character codes use 9-bit characters. ?or e"ample. $2%:)/* uses 1>-bit characters! #s networks developed! the disadvantages of embedding the character code length in the framing mechanism became more and more obvious! so a new techni0ue had to be developed to allow arbitrary si.ed characters.
Pro%lem with %yte stuffing Problem: fi"ed character si.e: assumes character si.e to be 9 bits : canRt handle heterogeneous environment.
0lag %ytes with %it stuffing The new techni0ue allows data frames to contain an arbitrary number of bits and allows character codes with an arbitrary number of bits per character. %t works like this. *ach frame begins and ends with a special bit pattern! 51111115 ,in fact! a flag byte-. (henever the sender+s data link layer encounters five consecutive 1s in the data! it automatically stuffs a 5 bit into the outgoing bit stream. This bit stuffing is analogous to byte stuffing! in which an escape byte is stuffed into the outgoing character stream before a flag byte in the data.
(hen the receiver sees five consecutive incoming 1 bits! followed by a 5 bit! it automatically destuffs ,i.e.! deletes- the 5 bit. Gust as byte stuffing is completely transparent to the network layer in both computers! so is bit stuffing. %f the user data contain the flag pattern! 51111115! this flag is transmitted as 511111515 but stored in the receiver+s memory as 51111115. ?igure 3-> gives an e"ample of bit stuffing.
Figure -6. )it stuffing. &a' The original data. &b' The data as they appear on the line. &c' The data as they are stored in the recei*er+s memory after destuffing.
9rror $ontrol
Positive and 2egative feedback Timers : what happens when a frame completely vanishes : receiver neither sends a Oack nor Dack S then timer comes to help. %t may result in a frame being sent more than once and received more than once : solution : assign se0uence numbers to frames %f the sender receives a positive acknowledgement about a frame! it knows the frame has arrived safely. )n the other hand! a negative acknowledgement means that something has gone wrong! and the frame must be transmitted again. the receiver will not react at all! since it has no reason to react. %t should be clear that a protocol in which the sender transmits a frame and then waits for an acknowledgement! positive or negative! will hang forever if a frame is ever lost due to! for e"ample! malfunctioning hardware.
6se of H, for error detection To detect d single bit errors ! we need ,an algorithm that creates- a code list with I/ at least d O 1 ?or eg . ?or the parity scheme .. I/ is 2 ..hence it can be used to detect single bit errors ,dM1-
Hamming $ode to correct one %it errors The bits of the :( are numbered left to right ! starting from 1 S the bits that are powers of 2 are check bits ,1!2!=!9 S- and the remaining are data bits. *"pand the position of each data bit in powers of 2 ..for eg. 11 M 1 O 2 O 9 .. o 11th bit contributes to the computation of value o o these check bits %.e. 1!2! 9 Hamming $ode to correct %urst errors
9rror detecting code Polynomial code or :A:, :yclic Aedundancy :heck $R$ # message m : a string of bits corresponds to a polynomial denote it by 6,"-. r check bits S.polynomial A,"-. Transmitted bits m O r S.polynomial T,"- M 6,"- O A," 7enerator polynomial 7,"-
r checkbits are computed so that when 7,"- divides T,"-! the remainder is .ero
(ill accept longer bursts ,without detecting- with probability only VTr 2ote : :ertain Polynomials have become international standards
ender: end frame with se0 number 2. (ait ,with timer- for ack with se0 number 2. %f timer e"pires: retransmit frame with se0 number 2 %f ack arrives : 2 M mod,2O1!2Aeceiver: Expect frame 2 %f 2 arrives: deliver to network layer! send ack for 2! 2 M mod,2O1!2%f any other se0 num: send previous ack ,mod,2-1!2-The main difference between this protocol for simple stop-and-wait is that the receiver knows which se0 num to e"pect and sender known which se0 num to send. This techni0ue is called Automatic Repeat Request ,#AF# imple" Protocol for a 2oisy :hannel
liding (indow Protocols a- # )ne-Bit liding (indow Protocol b- # Protocol $sing 7o Back 2 c- # Protocol $sing elective Aepeat
#lthough interleaving data and control frames on the same circuit is an improvement over having two separate physical circuits! yet another improvement is possible. (hen a data frame arrives! instead of immediately sending a separate control frame! the receiver restrains itself and waits until the network layer passes it the ne"t packet. The acknowledgement is attached to the outgoing data frame ,using the ack field in the frame header-. %n effect! the acknowledgement gets a free ride on the ne"t outgoing data frame. The techni0ue of temporarily delaying outgoing acknowledgements so that they can be hooked onto the ne"t outgoing data frame is known as piggybacking.
The principal advantage of using piggybacking over having distinct acknowledgement frames is a better use of the available channel bandwidth. The ack field in the frame header costs only a few bits! whereas a separate frame would need a header! the acknowledgement! and a checksum. %n addition! fewer frames sent
means fewer ++frame arrival++ interrupts! and perhaps fewer buffers in the receiver! depending on how the receiver+s software is organi.e
The ne"t three protocols are bidirectional protocols that belong to a class called sliding window protocols. The three differ among themselves in terms of efficiency! comple"ity! and buffer re0uirements! as discussed later. %n these! as in all sliding window protocols! each outbound frame contains a se0uence number! ranging from 5 up to some ma"imum. The ma"imum is usually 2 n - 1 so the se0uence number fits e"actly in an n-bit field. The stop-and-wait sliding window protocol uses n M 1! restricting the se0uence numbers to 5 and 1! but more sophisticated versions can use arbitrary n.
The essence of all sliding window protocols is that at any instant of time! the sender maintains a set of se0uence numbers corresponding to frames it is permitted to send. These frames are said to fall within the sending window. imilarly! the receiver also maintains a receiving window corresponding to the set of frames it is permitted to accept. The sender+s window and the receiver+s window need not have the same lower and upper limits or even have the same si.e. %n some protocols they are fi"ed in si.e! but in others they can grow or shrink over the course of time as frames are sent and received. liding (indow Protocols Ddiagram
Figure -1 . A sliding window of si-e 1. with a -bit se/uence number. &a' 0nitially. &b' After the first frame has been sent. &c' After the first frame has been recei*ed. &d' After the first ac$nowledgement has been recei*ed.
# sliding window of si.e 1! with a 3-bit se0uence number. ,a- %nitially. ,b- #fter the first frame has been sent.
,c- #fter the first frame has been received. ,d- #fter the first acknowledgement has been received. The se0uence numbers within the sender+s window represent frames that have been sent or can be sent but are as yet not acknowledged. (henever a new packet arrives from the network layer! it is given the ne"t highest se0uence number! and the upper edge of the window is advanced by one. (hen an acknowledgement comes in! the lower edge is advanced by one. %n this way the window continuously maintains a list of unacknowledged frames.
7o-back-2
;s.
elective-repeat
Figure -16. #ipelining and error reco*ery. 1ffect of an error when &a' recei*er+s window si-e is 1 and &b' recei*er+s window si-e is large.
Pipelining and error recovery. *ffect on an error when ,a- AeceiverRs window si.e is 1. ,b- AeceiverRs window si.e is large.
Two basic approaches are available for dealing with errors in the presence of pipelining. )ne way! called go %ack n! is for the receiver simply to discard all subse0uent frames! sending no acknowledgements for the discarded frames. This strategy corresponds to a receive window of si.e 1. %n other words! the data link layer refuses to accept any frame e"cept the ne"t one it must give to the network layer. %f the sender+s window fills up before the timer runs out! the pipeline will begin to empty. *ventually! the sender will time out and retransmit all unacknowledged frames in order! starting with the damaged or lost one. This approach can waste a lot of bandwidth if the error rate is high. The other general strategy for handling errors when frames are pipelined is called selective repeat. (hen it is used! a bad frame that is received is discarded! but good frames received after it are buffered. (hen the sender times out! only the oldest unacknowledged frame is retransmitted. %f that frame arrives correctly! the receiver can deliver to the network layer! in se0uence! all the frames it has buffered. elective repeat is often combined with having the receiver send a negative acknowledgement ,2#4- when it detects an error! elective repeat corresponds to a receiver window larger than 1. #ny frame within the window may be accepted and buffered until all the preceding ones have been passed to the network layer. This approach can re0uire large amounts of data link layer memory if the window is large.
#ll PPP frames begin with the standard I/1: flag byte ,51111115-! which is byte stuffed if it occurs within the payload field. 2e"t comes the #ddress field! which is always set to the binary value 11111111 to indicate that all stations are to accept the frame. $sing this value avoids the issue of having to assign data link addresses. The #ddress field is followed by the :ontrol field! the default value of which is 55555511. This value indicates an unnumbered frame. %n other words! PPP does not provide reliable transmission using se0uence numbers and acknowledgements as the default. %n noisy environments! such as wireless networks! reliable transmission using numbered mode can be used. The e"act details are defined in A?: 1>>3! but in practice it is rarely used. ince the #ddress and :ontrol fields are always constant in the default configuration! 1:P provides the necessary mechanism for the two parties to negotiate an option to 'ust omit them altogether and save 2 bytes per frame. The fourth PPP field is the Protocol field. %ts 'ob is to tell what kind of packet is in the Payload field. :odes are defined for 1:P! 2:P! %P! %PN! #ppleTalk! and other protocols. Protocols starting with a 5 bit are network layer protocols such as %P! %PN!
) % :12P! N2 . Those starting with a 1 bit are used to negotiate other protocols. These include 1:P and a different 2:P for each network layer protocol supported. The default si.e of the Protocol field is 2 bytes! but it can be negotiated down to 1 byte using 1:P. The Payload field is variable length! up to some negotiated ma"imum. %f the length is not negotiated using 1:P during line setup! a default length of 1<55 bytes is used. Padding may follow the payload if need be. #fter the Payload field comes the :hecksum field! which is normally 2 bytes! but a =byte checksum can be negotiated. %n summary! PPP is a multiprotocol framing mechanism suitable for use over modems! I/1: bit-serial lines! )2*T! and other physical layers. %t supports error detection! option negotiation! header compression! and! optionally! reliable transmission using an I/1:-type frame format
communicate! some of them will be denied permission for lack of bandwidth! even if some of the users who have been assigned a fre0uency band hardly ever transmit or receive anything.
The poor performance of static ?/6 can easily be seen from a simple 0ueueing theory calculation. 1et us start with the mean time delay! T! for a channel of capacity : bps! with an arrival rate of frames8sec! each frame having a length drawn from an e"ponential probability density function with mean 18Y bits8frame. (ith these parameters the arrival rate is frames8sec and the service rate is Y: frames8sec. ?rom 0ueueing theory it can be shown that for Poisson arrival and service times!
TM18Y:-Z
2ow let us divide the single channel into 2 independent subchannels! each with capacity :82 bps. The mean input rate on each of the subchannels will now be 82. Aecomputing T we get
TM18Y,:82--,Z82-M28 Y:-ZM2T
,=.1-
The mean delay using ?/6 is 2 times worse than if all the frames were somehow magically arranged orderly in a big central 0ueue. Precisely the same arguments that apply to ?/6 also apply to time division multiple"ing ,T/6-. *ach user is statically allocated every 2th time slot. %f a user does not use the allocated slot! it 'ust lies fallow. The same holds if we split up the networks physically.
Station Model& The model consists of 2 independent stations ,e.g.! computers! telephones! or personal communicators-! each with a program or user that generates frames for transmission. tations are sometimes called terminals. The probability of a frame being generated in an interval of length t is t! where is a constant ,the arrival rate of new frames-. )nce a frame has been generated! the station is blocked and does nothing until the frame has been successfully transmitted. Single $hannel Assum"tion& # single channel is available for all communication. #ll stations can transmit on it and all can receive from it. #s far as the hardware is
concerned! all stations are e0uivalent! although protocol software may assign priorities to them. $ollision Assum"tion& %f two frames are transmitted simultaneously! they overlap in time and the resulting signal is garbled. This event is called a collision. #ll stations can detect collisions. # collided frame must be transmitted again later. There are no errors other than those generated by collisions. 2a& $ontinuous Time& ?rame transmission can begin at any instant. There is no master clock dividing time into discrete intervals. 2%& Slotted Time& Time is divided into discrete intervals ,slots-. ?rame transmissions always begin at the start of a slot. # slot may contain 5! 1! or more frames! corresponding to an idle slot! a successful transmission! or a collision! respectively. <a& $arrier Sense& tations can tell if the channel is in use before trying to use it. %f the channel is sensed as busy! no station will attempt to use it until it goes idle. <%& No $arrier Sense& tations cannot sense the channel before trying to use it. They 'ust go ahead and transmit. )nly later can they determine whether the transmission was successful.
#ure A345A
The basic idea of an #1)I# system is simple: let users transmit whenever they have data to be sent. There will be collisions! of course! and the colliding frames will be damaged.The feedback property of broadcasting! a sender can always find out whether its frame was destroyed by listening to the channel! the same way other users do. (ith a 1#2! the feedback is immediate. with a satellite! there is a delay of 2L5 msec before the sender knows if the transmission was successful. %f listening while transmitting is not possible for some reason! acknowledgements are needed. %f the frame was destroyed! the sender 'ust waits a random amount of time and sends it again. The waiting time must be random or the same frames will collide over and over! in lockstep. ystems in which multiple users share a common channel in a way that can lead to conflicts are widely known as contention systems.
1. 2. 3. =.
#1)I# :arrier ense 6ultiple #ccess Protocols :ollision-?ree Protocols (ireless 1#2 Protocols
A)5HA =
#loha is a computer networking system which was introduced in the early 1PL5 by 2orman #bramson and his colleagues at university of Iawaii to solve the channel allocation problem. )n the basis of global time synchroni.ation. #loha is divided into two different versions or protocols. i.e Pure #loha and lotted #loha.
Pure &loha/
Pure #loha does not re0uire global time synchroni.ation. The basic idea of pure aloha system is that it allows its users to transmit whenever they have data.# sender 'ust like other users can listen to what it is transmitting! and due to this feedback broadcasting system is able to detect collision! if any. %f the collision is detected the sender will wait a random period of time and attempt transmission again. The waiting time must not be the same or the same frames will collide and destroyed over and over. ystems in which multiple users share a common channel in a way that can lead to conflicts are widely known as contention systems.
other stations to refrain from transmitting between t-T and t as well! because a frame sent during this interval would overlap with our frame.
(henever two frames try to occupy the channel at the same time! there will be a collision and both will be garbled. %f the first bit of a new frame overlaps with 'ust the last bit of a frame almost finished! both frames will be totally destroyed and both will have to be retransmitted later. The checksum cannot ,and should not- distinguish between a total loss and a near miss. Bad is bad ;ulnerable period for the shaded frame is 2t! if t is the frame time. # frame will not collide if no other frames are sent within one frame time of its start! before and after. ?or any frame-time! the probability of there being k transmission-attempts during that frame-time is: B7Tk eTB-7CC 8 Bk\C %f throughput ,number of packets per unit timeis represented by ! under all load! M7Po! where Po is the probability that the frame does not suffer collision. # frame does not have collision if no frames are send during the frame time. Thus! in t time PoM,e-T,-7-. %n 2t time PoMeT,-27-! as mean number of frames generated in 2t is 27. ?rom the above! throughput in 2t time M7E,Po-M7EeT,-27-. The probability that k frames are generated during a given frame time is given by the Poisson distribution: so the probability of .ero frames is 'ust e-7. %n an interval two frame times long! the mean number of frames generated is 27. The probability of no other traffic being initiated during the entire vulnerable period is thus given by P5 M e -27. $sing M 7P5! we get
Pure #loha vs lotted #loha Throughput versus offered traffic for pure #1)I# and slotted #1)I# systems! ie! plot of against 7! from M7eT,-27- and M7eT,-7- formulas.
T>P9S 50 $SMA=
The different types of the : 6# are as under: 1. Persistent : 6# 2. 2on-persistent : 6# o P-persistent : 6#
1. Per"i"tent CS-&/
%n 1-persistent carrier sense protocol! the sender or station first listens to the channel and if the channel is not busy! it transmits the data with a probability of 1.%f a station finds the channel busy! it waits until the channel gets free or becomes idle. %f a collision occurs! the station waits a random amount of time and attempts the same procedure again. The propagation delay has an important effect on the performance of the protocol. :onsider a situation in which a station begins sending! and another station also senses an idle channel. %f the first station+s signal has not yet reached the second one! the latter station will sense an idle channel and will also begin sending! resulting in a collision. The longer the propagation delay! the worse is the performance of the protocol. #ssume that the propagation delay is .ero! there will still be collisions because if two stations become ready while anther+s station transmission! both will wait until the transmission ends and then both will begin transmitting e"actly simultaneously! resulting in a collision. This protocol will lead to higher efficiency than the pure ore slotted #1)I#.
P-"ersistent $SMA=
%n this protocol! when the sender is ready to transmit data! it senses the channel and if it senses an idle channel! it starts sending the frame with a probability of P i.e. the probability of not sending the frame till the ne"t time slot is 0M1-P.%f the station finds the channel busy! it waits until the beginning of the ne"t time slot to repeat the same procedure.
$5MPARIS5N 50 P9RSIST9NT
P9RSIST9NT
AN,
N5N
#fter a station detects a collision! it aborts its transmission! waits a random period of time! and then tries again! assuming that no other station has started transmitting in the meantime. Therefore! our model for : 6#8:/ will consist of alternating contention and transmission periods! with idle periods occurring when all stations are 0uiet ,e.g.! for lack of work-.
The protocol supports three traffic classes : ,1- constant data rate connection-oriented traffic! such as uncompressed video! ,2- variable data rate connection-oriented traffic! such as file transfer! and ,3- datagram traffic! such as $/P packets. ?or the two connection-oriented protocols! the idea is that for # to communicate with B! it must first insert a :)22*:T%)2 A*F$* T frame in a free slot on B+s control channel. %f B accepts! communication can take place on #+s data channel. *ach station has two transmitters and two receivers! as follows: 1. # fi"ed-wavelength receiver for listening to its own control channel. 2. # tunable transmitter for sending on other stations+ control channels. 3. # fi"ed-wavelength transmitter for outputting data frames. =. # tunable receiver for selecting a data transmitter to listen to.
1.3 #thernet
The %*** has standardi.ed a number of local area networks and metropolitan area networks under the name of %*** 952 Q *thernet :abling Q 6anchester *ncoding Q The *thernet 6#: ublayer Protocol Q The Binary *"ponential Backoff #lgorithm Q *thernet Performance Q witched *thernet Q ?ast *thernet Q 7igabit *thernet Q %*** 952.2: 1ogical 1ink :ontrol
Figure %-1%. Three $inds of 1thernet cabling. &a' 16)ase8. &b' 16)ase!. &c' 16)ase-T.
TIM9 ,5MAIN R90)9$T5M9TR>& /etecting cable breaks! e"cessive length! bad taps! or loose connectors can be a ma'or problem with both media. ?or this reason! techni0ues have been developed to track them down. Basically! a pulse of known shape is in'ected into the cable. %f the pulse hits an obstacle or the end of the cable! an echo will be generated and sent back. By carefully timing the interval between sending the pulse and receiving the echo! it is possible to locali.e the origin of the echo. This techni0ue is called time domain reflectometry. The problems associated with finding cable breaks drove systems toward a different kind of wiring pattern! in which all stations have a cable running to a central hub in which they are all connected electrically ,as if they were soldered together-. $sually! these wires are telephone company twisted pairs! since most office buildings are already wired this way! and normally plenty of spare pairs are available. This scheme is called 15Base-T. Iubs do not buffer incoming traffic. (e will discuss an improved version of this idea ,switches-! which do buffer incoming traffic later in this chapter. These three wiring schemes are illustrated in ?ig. =-1=. ?or 15Base<! a transceiver is clamped securely around the cable so that its tap makes contact with the inner core. The transceiver contains the electronics that handle carrier detection and collision detection. (hen a collision is detected! the transceiver also puts a special invalid signal on the cable to ensure that all other transceivers also reali.e that a collision has occurred. (ith 15Base<! a transceiver cable or drop cable connects the transceiver to an interface board in the computer. The transceiver cable may be up to <5 meters long and contains five individually shielded twisted pairs. Two of the pairs are for data in and data out! respectively. Two more are for control signals in and out. The fifth pair! which is not always used! allows the computer to power the transceiver electronics. ome transceivers allow up to eight nearby computers to be attached to them! to reduce the number of transceivers needed. The transceiver cable terminates on an interface board inside the computer. The interface board contains a controller chip that transmits frames to! and receives frames from! the transceiver. The controller is responsible for assembling the data into the proper frame format! as well as computing checksums on outgoing frames and
verifying them on incoming frames. ome controller chips also manage a pool of buffers for incoming frames! a 0ueue of buffers to be transmitted! direct memory transfers with the host computers! and other aspects of network management. (ith 15Base2! the connection to the cable is 'ust a passive B2: T-'unction connector. The transceiver electronics are on the controller board! and each station always has its own transceiver. (ith 15Base-T! there is no shared cable at all! 'ust the hub ,a bo" full of electronicsto which each station is connected by a dedicated ,i.e.! not shared- cable. #dding or removing a station is simpler in this configuration! and cable breaks can be detected easily. The disadvantage of 15Base-T is that the ma"imum cable run from the hub is only 155 meters! maybe 255 meters if very high 0uality category < twisted pairs are used. 2evertheless! 15Base-T 0uickly became dominant due to its use of e"isting wiring and the ease of maintenance that it offers. # faster version of 15Base-T ,155Base-T- will be discussed later in this chapter. # fourth cabling option for *thernet is 15Base-?! which uses fiber optics. This alternative is e"pensive due to the cost of the connectors and terminators! but it has e"cellent noise immunity and is the method of choice when running between buildings or widely-separated hubs. Auns of up to km are allowed. %t also offers good security since wiretapping fiber is much more difficult than wiretapping copper wire.
Figure %-18. Cable topologies. &a' 3inear. &b' "pine. &c' Tree. &d' "egmented.
Figure %-19. Frame formats. &a' :0; 1thernet. &b' 0111 ,6!. .
The frame contains two addresses! one for the destination and one for the source. The standard allows 2-byte and >-byte addresses! but the parameters defined for the 156bps baseband standard use only the >-byte addresses. The high-order bit of the destination address is a 5 for ordinary addresses and 1 for group addresses. 7roup addresses allow multiple stations to listen to a single address. (hen a frame is sent to a group address! all the stations in the group receive it. ending to a group of stations is called multicast. The address consisting of all 1 bits is reserved for broadcast. # frame containing all 1s in the destination field is accepted by all stations on the network. The difference between multicast and broadcast is important enough to warrant repeating. # multicast frame is sent to a selected group of stations on the *thernet& a broadcast frame is sent to all stations on the *thernet. 6ulticast is more selective! but involves group management. Broadcasting is coarser but does not re0uire any group management. #nother interesting feature of the addressing is the use of bit => ,ad'acent to the highorder bit- to distinguish local from global addresses. 1ocal addresses are assigned by each network administrator and have no significance outside the local network. 7lobal addresses! in contrast! are assigned centrally by %*** to ensure that no two stations anywhere in the world have the same global address. (ith =9 - 2 M => bits available! there are about L " 1513 global addresses. The idea is that any station can uni0uely address any other station by 'ust giving the right =9-bit number. %t is up to the network layer to figure out how to locate the destination. 2e"t comes the Type field! which tells the receiver what to do with the frame. 6ultiple network-layer protocols may be in use at the same time on the same
machine! so when an *thernet frame arrives! the kernel has to know which one to hand the frame to. The Type field specifies which process to give the frame to. 2e"t come the data! up to 1<55 bytes. This limit was chosen somewhat arbitrarily at the time the /%N standard was cast in stone! mostly based on the fact that a transceiver needs enough A#6 to hold an entire frame and A#6 was e"pensive in 1PL9. # larger upper limit would have meant more A#6! hence a more e"pensive transceiver. %n addition to there being a ma"imum frame length! there is also a minimum frame length. (hile a data field of 5 bytes is sometimes useful! it causes a problem. (hen a transceiver detects a collision! it truncates the current frame! which means that stray bits and pieces of frames appear on the cable all the time. To make it easier to distinguish valid frames from garbage! *thernet re0uires that valid frames must be at least >= bytes long! from destination address to checksum! including both. %f the data portion of a frame is less than => bytes! the Pad field is used to fill out the frame to the minimum si.e
1.3 0luetooth
%n 1PP=! the 1. 6. *ricsson company became interested in connecting its mobile phones to other devices ,e.g.! P/#s- without cables. Together with four other companies ,%B6! %ntel! 2okia! and Toshiba-! it formed a %7 , pecial %nterest 7roup! i.e.! consortium- to develop a wireless standard for interconnecting computing and communication devices and accessories using short-range! low-power! ine"pensive wireless radios. The pro'ect was named Bluetooth! after Iarald Blaatand ,Bluetooth%% ,P=5-P91-! a ;iking king who unified ,i.e.! con0uered- /enmark and 2orway! also without cables.
The generic access profile is not really an application! but rather the basis upon which the real applications are built. %ts main 'ob is to provide a way to establish and maintain secure links ,channels- between the master and the slaves. #lso relatively generic is the service discovery profile! which is used by devices to discover what services other devices have to offer. #ll Bluetooth devices are e"pected to implement these two profiles. The remaining ones are optional. The serial port profile is a transport protocol that most of the remaining profiles use. %t emulates a serial line and is especially useful for legacy applications that e"pect a serial line. The generic ob'ect e"change profile defines a client-server relationship for moving data around. :lients initiate operations! but a slave can be either a client or a server. 1ike the serial port profile! it is a building block for other profiles. The ne"t group of three profiles is for networking. The 1#2 access profile allows a Bluetooth device to connect to a fi"ed network. This profile is a direct competitor to 952.11. The dial-up networking profile was the original motivation for the whole pro'ect. %t allows a notebook computer to connect to a mobile phone containing a built-in modem without wires. The fa" profile is similar to dial-up networking! e"cept that it allows wireless fa" machines to send and receive fa"es using mobile phones without a wire between the two.
The ne"t three profiles are for telephony. The cordless telephony profile provides a way to connect the handset of a cordless telephone to the base station. :urrently! most cordless telephones cannot also be used as mobile phones! but in the future! cordless and mobile phones may merge. The intercom profile allows two telephones to connect as walkie-talkies. ?inally! the headset profile provides hands-free voice communication between the headset and its base station! for e"ample! for hands-free telephony while driving a car. The remaining three profiles are for actually e"changing ob'ects between two wireless devices. These could be business cards! pictures! or data files. The synchroni.ation profile! in particular! is intended for loading data into a P/# or notebook computer when it leaves home and collecting data from it when it returns.
The ne"t layer up is the middleware layer! which contains a mi" of different protocols. The 952 11: was inserted here by %*** for compatibility with its other 952 networks. The A?comm! telephony! and service discovery protocols are native. A?comm ,Aadio ?re0uency communication- is the protocol that emulates the standard serial port found on P:s for connecting the keyboard! mouse! and modem! among other devices. %t has been designed to allow legacy devices to use it easily. The telephony protocol is a real-time protocol used for the three speech-oriented profiles. %t also manages call setup and termination. ?inally! the service discovery protocol is used to locate services within the network. The top layer is where the applications and profiles are located. They make use of the protocols in lower layers to get their work done. *ach application has its own dedicated subset of the protocols. pecific devices! such as a headset! usually contain only those protocols needed by that application and no others.