Вы находитесь на странице: 1из 58

COMPUTER NETWORKS

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

1.2 Network Hardware


There are two types of transmission technology that are in widespread use. They are as follows: 1. Broadcast links. 2. Point-to-point links. Broadcast networks have a single communication channel that is shared by all the machines on the network. hort messages! called packets in certain conte"ts! sent by any machine are received by all the others. #n address field within the packet specifies the intended recipient. $pon receiving a packet! a machine checks the address field. %f the packet is intended for the receiving machine! that machine processes the packet& if the packet is intended for some other machine! it is 'ust ignored. Broadcast systems generally also allow the possibility of addressing a packet to all destinations by using a special code in the address field. (hen a packet with this code is transmitted! it is received and processed by every machine on the network. This mode of operation is called %roadcasting. ome broadcast systems also support transmission to a subset of the machines! something known as multicasting. )ne possible scheme is to reserve one bit to indicate multicasting. The remaining n - 1 address bits can hold a group number. *ach machine can ++subscribe++ to any or all of the groups. (hen a packet is sent to a certain group! it is delivered to all machines subscribing to that group. The point-to-point networks consist of many connections between individual pairs of machines. To go from the source to the destination! a packet on this type of network may have to first visit one or more intermediate machines. )ften multiple routes! of different lengths! are possible! so finding good ones is important in point-to-point networks. #s a general rule ,although there are many e"ceptions-! smaller! geographically locali.ed networks tend to use broadcasting! whereas larger networks usually are point-to-point. Point-to-point transmission with one sender and one receiver is sometimes called unicasting&

Figure 1-6. Classification of interconnected processors by scale.


#t the top are the personal area networks! networks that are meant for one person. # wireless network connecting a computer with its mouse! keyboard! and printer is a personal area network.# P/# that controls the user+s hearing aid or pacemaker fits in this category. Beyond the personal area networks come longer-range networks. These can be divided into local! metropolitan! and wide area networks.The connection of two or more networks is called an internetwork. The worldwide %nternet is a wellknown e"ample of an internetwork. /istance is important as a classification metric because different techni0ues are used at different scales.

'&(&' )ocal Area Networks


1ocal area networks! generally called 1#2s! are privately-owned networks within a single building or campus of up to a few kilometers in si.e. 1#2s are distinguished from other kinds of networks by three characteristics: ,1- their si.e! ,2- their transmission technology! and ,3- their topology. 1#2s are restricted in si.e! which means that the worst-case transmission time is bounded and known in advance. 4nowing this bound makes it possible to use certain kinds of designs that would not otherwise be possible. %t also simplifies network management. 1#2s may use a transmission technology consisting of a cable to which all the machines are attached! like the telephone company party lines once used in rural areas. Traditional 1#2s run at speeds of 15 6bps to 155 6bps! have low delay ,microseconds or nanoseconds-! and make very few errors. 2ewer 1#2s operate at up to 15 7bps. %n this book! we will adhere to tradition and measure line speeds in megabits8sec ,1 6bps is 1!555!555 bits8sec- and gigabits8sec ,1 7bps is 1!555!555!555 bits8sec-. The arbitration mechanism may be centrali.ed or distributed. %*** 952.3! popularly called *thernet! for e"ample! is a bus-based broadcast network with decentrali.ed control! usually operating at 15 6bps to 15 7bps. :omputers on an *thernet can

transmit whenever they want to& if two or more packets collide! each computer 'ust waits a random time and tries again later.

Network Classification by Topology


Aing

Aepeater

Aepeater

Note - a ring implies unidirectional flow

# 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.

'&(&( Metro"olitan Area Networks


# metropolitan area network! or 6#2! covers a city. The best-known e"ample of a 6#2 is the cable television network available in many cities. This system grew from earlier community antenna systems used in areas with poor over-the-air television reception

MAN
1E

a
2 3 =

A
d

6etropolitan network A consists of access subnetworks a! b! c! d.

Hierarchical Network Topology


A

2ational network consists of regional subnetworks , , . 6etropolitan network # is part of regional subnetwork .

'&(&. /ide Area Networks


(#2s B(ide #rea 2etworksC D also referred to as point-to-point networks. D #AP#2*T %nternet D usually hierarchical with a backbone. D *nterprise 2etworks! #utonomous ystems ,# sD ;P2s ,;irtual Private 2etworks-.

0igure '-'1&A stream of "ackets from sender to recei+er&

'&(&2 /ireless Networks


(ireless networks can be divided into three main categories:

1. ystem interconnection. 2. (ireless 1#2s. 3. (ireless (#2s.

Wireless LANs

Figure 1-35. (a) Wireless networking with a base station. (b) Ad hoc networking.

'&(&3 Internet works


# collection of interconnected networks is called an internet work or internet. The fulfillment of this desire re0uires that different! and fre0uently incompatible networks! be connected! sometimes by means of machines called gateways to make the connection and provide the necessary translation! both in terms of hardware and software

1.3 Network Software


To reduce their design comple"ity! most networks are organi.ed as a stack of layers or levels! each one built upon the one below it. The number of layers! the name of each layer! the contents of each layer! and the function of each layer differ from network to network 1ayer n on one machine carries on a conversation with layer n on another machine. The rules and conventions used in this conversation are collectively known as the layer n protocol A "rotocol is an agreement %etween the communicating "arties on how communication is to "roceed& *etween each "air of ad4acent layers is an interface& The interface defines which primitive operations and services the lower layer makes available to the upper one. (hen network designers decide how many layers to include in a network and what each one should do! one of the most important considerations is defining clean interfaces between the layers. A set of layers and "rotocols is called a network architecture& A list of "rotocols used %y a certain system! one "rotocol "er layer! is called a "rotocol stack&

'&.&( ,esign Issues for the )ayers


*very layer needs a mechanism for identifying senders and receivers called addressing

*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

'&.&. $onnection-5riented and $onnectionless Ser+ices


:onnection-oriented service is modeled after the telephone system! the service user first establishes a connection! uses the connection! and then releases the connection. $onnectionless ser+ice is modeled after the postal system. *ach message ,lettercarries the full destination address! and each one is routed through the system independent of all the other. :onnection-oriented network is #T6 ,#synchronous Transfer 6ode-. The basic idea behind #T6 is to transmit all information in small! fi"ed-si.e packets called cells. The cells are <3 bytes long! of which < bytes are header and =9 bytes are payload ATM $ell Structure #t either a private or a public user-network interface ,$2%-! an #T6 cell always consists of a <-byte header followed by a =9-byte payload. The header is composed of si" elements! each detailed in ?igure 1=.>.

0igure '2&3 ATM $ell Header Structure

Generic Flow Control


The 7eneric ?low :ontrol ,7?:- field is a =-bit field that was originally added to support the connection of #T6 networks to shared access networks such as a /istributed Fueue /ual Bus ,/F/B- ring. The 7?: field was designed to give the $ser-2etwork %nterface ,$2%- = bits in which to negotiate multiple"ing and flow control among the cells of various #T6 connections.

Virtual Path Identifier


The ;irtual Path %dentifier ,;P%- defines the virtual path for this particular cell. ;P%s for a particular virtual channel connection are discovered during the connection setup process for switched virtual circuit , ;:- connections and manually configured for permanent virtual circuit ,P;:- connections. #t the $2%! the ;P% length of 9 bits allows up to 2<> different virtual paths. ;P% 5 e"ists by default on all #T6 e0uipment and is used for administrative purposes such as signaling to create and delete dynamic #T6 connections.

Virtual Channel Identifier


The ;irtual :hannel %dentifier ,;:%- defines the virtual channel within the specified virtual path for this particular cell. Gust as with ;P%s! ;:%s are also discovered during the connection setup process for switched virtual circuit , ;:- connections and manually configured for permanent virtual circuit ,P;:- connections. The ;:% length of 1> bits allows up to ><!<3> different virtual channels for each virtual path. ;:%s 5 to 1< are reserved by the %T$ and ;:%s from1> to 32 are reserved by the #T6 ?orum ,for each virtual path-. These reserved ;:%s are used for signaling! operation and maintenance! and resource management.

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.

Cell !o"" Priority


The :ell 1oss Priority ,:1P- field is a 1-bit field used as a priority indicator. (hen it is set to 5! the cell is high priority and interim switches must make every effort to forward the cell successfully. (hen the :1P bit is set to 1! the interim switches sometimes discard the cell in congestion situations. The :1P bit is very similar to the /iscard *ligibility ,/*- bit in ?rame Aelay.

Header #rror Check


The Ieader *rror :heck ,I*:- field is an 9-bit field that allows an #T6 switch or #T6 endpoint to correct a single-bit error or to detect multi-bit errors in the first = bytes of the #T6 header. 6ulti-bit errored cells are silently discarded. The I*: only checks the #T6 header and not the #T6 payload. :hecking the payload for errors is the responsibility of upper layer protocols.

The ATM Reference Model


#synchronous Transfer 6ode ,#T6- is a switching techni0ue for telecommunication networks. %t uses asynchronous time-division multiple"ing!J1KJ2K and it encodes data into small! fi"edsi.ed cells. This differs from networks such as the %nternet or *thernet 1#2s that use variable si.ed packets or frames. #T6 provides data link layer services that run over ) % 1ayer 1 physical links. #T6 has functional similarity with both circuit switched networking and small packet switched networking. This makes it a good choice for a network that must handle both traditional high-speed data traffic ,e.g.! file transfers-! and real-time! low-latency content such as voice and video. #T6 uses a connectionoriented model in which a virtual circuit must be established between two endpoints before the actual data e"change begins.J2K #T6 is a core protocol used over the )2*T8 /I backbone of the %ntegrated ervices /igital 2etwork ,% /2-.

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

Payload and padding if necessary ,=9 bytes-

/iagram of the 22% #T6 :ell L ;P% ;P% ;:% ;:% I*: PT :1P ;:% = 3 5

Payload and padding if necessary ,=9 bytes-

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

$ontrol "lane Higher )ayers

6ser "lane Higher )ayers

ATM Ada"tation )ayer ATM )ayer


7irtual $hannel 0unctions 7irtual Path 0unctions

Plane management )ayer management

Physical )ayer PM,#

Figure 1- !. The ATM reference model.


1ayer 2ame Iigher 1ayers # :onvergence # ub-layer ,: ?unction Iigher 1ayer ?unction ervice pecific , :ommon Part ,:P-

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.

(&(&' Magnetic Media


)ne of the most common ways to transport data from one computer to another is to write them onto magnetic tape or removable media ,e.g.! recordable /;/s-! physically transport the tape or disks to the destination machine! and read them back in again. (&(&( Twisted Pair # twisted pair consists of two insulated copper wires! typically about 1 mm thick. The wires are twisted together in a helical form! 'ust like a /2# molecule. Twisted pairs can be used for transmitting either analog or digital signals. The bandwidth depends on the thickness of the wire and the distance traveled! but several megabits8sec can be achieved for a few kilometers in many cases. /ue to their ade0uate performance and low cost! twisted pairs are widely used and are likely to remain so for years to come :ategory 3 twisted pairs consist of two insulated wires gently twisted together. category < twisted pairs were introduced. They are similar to category 3 pairs! but with more twists per centimeter! which results in less crosstalk and a better-0uality signal over longer distances! making them more suitable for high-speed computer communication. $p-and-coming categories are > and L! which are capable of handling signals with bandwidths of 2<5 6I. and >55 6I.! respectively

(&(&. $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.

(&(&2 0i%er 5"tics


#n optical transmission system has three key components: the light source! the transmission medium! and the detector. :onventionally! a pulse of light indicates a 1 bit and the absence of light indicates a 5 bit. The transmission medium is an ultra-thin fiber of glass. The detector generates an electrical pulse when light falls on it. By attaching a light source to one end of an optical fiber and a detector to the other! we have a unidirectional data transmission system that accepts an electrical signal! converts and transmits it by light pulses! and then reconverts the output to an electrical signal at the receiving end.

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.

(&.&' The 9lectromagnetic S"ectrum


(hen electrons move! they create electromagnetic waves that can propagate through space ,even in a vacuum-The number of oscillations per second of a wave is called its fre0uency! f! and is measured in I. ,in honor of Ieinrich Iert.-. The distance between two consecutive ma"ima ,or minima- is called the wavelength! which is universally designated by the 7reek letter ,lambda-.

(&2 $ommunication Satellites

# 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.

(&2&' :eostationary Satellites


The invention of the transistor changed all that! and the first artificial communication satellite! Telstar! was launched in Guly 1P>2. ince then! communication satellites have become a multibillion dollar business and the only aspect of outer space that has become highly profitable. These high-flying satellites are often called 7*) ,7eostationary *arth )rbit- satellites.

(&2&( Medium-9arth 5r%it Satellites


#t much lower altitudes! between the two ;an #llen belts! we find the 6*) ,6edium-*arth )rbit- satellites. #s viewed from the earth! these drift slowly in longitude! taking something like > hours to circle the earth. #ccordingly! they must be tracked as they move through the sky. Because they are lower than the 7*)s! they have a smaller footprint on the ground and re0uire less powerful transmitters to reach them. :urrently they are not used for telecommunications! so we will not e"amine them further here. The 2= 7P ,7lobal Positioning ystem- satellites orbiting at about 19!555 km are e"amples of 6*) satellites.

(&2&. )ow-9arth 5r%it Satellites


6oving down in altitude! we come to the 1*) ,1ow-*arth )rbit- satellites. /ue to their rapid motion! large numbers of them are needed for a complete system. )n the other hand! because the satellites are so close to the earth! the ground stations do not need much power! and the round-trip delay is only a few milliseconds. %n this section we will e"amine three e"amples! two aimed at voice communication and one aimed at %nternet service.

Public witched Telephone ystem The properties of Telephones The 1ocal 1oop: 6odems! #/ 1 and (ireless Trunks and 6ultiple"ing witching

A ty"ical circuit route for a medium-distance call


*ach phone has two copper wires going directly to the nearest end office. This connection is called a local loo". The typical distance is 1 to 15 km. *ach end office has a number of outgoing lines ,coa"ial cables! microwaves! or even fiber optics- to one or more nearby switching centers! called toll offices. Toll offices are connected to sectional or regional offices that form a network! communicating by high bandwidth intertoll trunks ,fiber optics-.

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

Three forms of modulation

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.

An example o three orms o modulation


(a) A binar! signal (b) Amplitude modulation

(c) Fre"uenc! modulation (d) #hase modulation

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.

$2%T -2 TI* PI@ %:#1 1#@*A


%&T& !IN' !&(#) %#SIGN ISS*#S + #)),) %#T#CTI,N &N% C,))#CTI,N + #!#-#NT&)( %&T&!IN' P),T,C,!S + S!I%ING .IN%,. P),T,C,!S + %&T& !IN' !&(#) IN TH# INT#)N#T.

$ha"ter .& The ,ata )ink )ayer


3.1 %ata !ink !ayer %e"i$n I""ue"
The data link layer has a number of specific functions it can carry out. These functions include '& Pro+iding a well-defined ser+ice interface to the network layer& (& ,ealing with transmission errors& .& Regulating the flow of data so that slow recei+ers are not swam"ed %y fast senders&

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

0I: .&' a# 7irtual communication! %#Actual communication

Figure -1. Relationship between pac$ets and frames.

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.

Acknowledged $onnection-oriented ser+ice Most relia%le! :uaranteed ser+ice

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.

0ig .&. Placement of data )ink "rotocol

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.

0raming with $haracter $ount

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.

.&'&2 0low $ontrol


when the sender is running on a fast ,or lightly loaded- computer and the receiver is running on a slow ,or heavily loaded- machine. The sender keeps pumping the frames out at a high rate until the receiver is completely swamped. *ven if the transmission is error free! at a certain point the receiver will simply be unable to handle the frames as they arrive and will start to lose some. Two approaches are commonly used. %n the first one! feedback-based flow control! the receiver sends back information to the sender giving it permission to send more data or at least telling the sender how the receiver is doing. %n the second one! rate-based flow control! the protocol has a built-in mechanism that limits the rate at which senders may transmit data! without using feedback from the receiver

.&( 9rror ,etection and $orrection


%n some cases it is sufficient to detect an error and in some! it re0uires the errors to be corrected also. ?or eg. )n a reliable medium : */ is sufficient where the error rate is low and asking for retransmission after */ would work efficiently %n contrast! on an unreliable medium : Aetransmission after */ may result in another error and still another and so on. Ience *: is desirable. Hamming $odes = for 9, n 9$ m data bits together with r error check bits form an n M ,m O r- bit codeword The number of bits two code words differ in is called the hamming distance between the two code words ignificance : %f two code words are at I/ d then it re0uires d single bit errors to convert one into the other H, of a coding scheme ?or m bit data .. #ll the 2Tm possible combinations are legal But not all the 2Tn codewords are used -- in a coding scheme ,algorithm to compute the check bits- some of these codewords are legal and others are illegal ?or e0 .. :onsider parity : 1,r M 1- parity bit is appended with value so that the total number of 1Rs in the codeword is even .. Then 11511 is a legal codeword in this scheme but 11515 is not

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

Figure -,. Calculation of the polynomial code chec$sum.


#t the receiving end! receiver again divides the polynomial corresponding to the received bits by 7,"- and accepts it iff the remainder is .ero. 2ow let *,"- denote the polynomial corresponding to the errored bits. Then receiver receives TR,"- M T,"- O *," 7,"- divides TR,"- iff it divides *,":A: /etecting single bit errors *,"- M "Ti :hoose 7,"- M any polynomial with at least two terms /etecting 2 single bit errors *,"- M "Ti O "T' M "Ti ," T ,'-i- O 1:hoose 7,"- s.t it neither divides " nor divides "Tk O 1 for any k UM frame length /etecting odd number of single bit errors *,"- canRt be of the form ," O 1- F,":hoose 7,"- of the type ," O 1- F,"7,"- M a general polyn of degree r (ill detect single burst of length UM r (ill accept ,without detecting- bursts of length rO1 with probably only VT,r1-

(ill accept longer bursts ,without detecting- with probability only VTr 2ote : :ertain Polynomials have become international standards

9lementary ,ata )ink Protocols


a- #n $nrestricted imple" Protocol b- # imple" top-and-(ait Protocol c- # imple" Protocol for a 2oisy :hannel *ach protocol is increasing in comple"ity and drops unrealistic assumptions.

#2 $nrestriced simple" protocol


Assumption 1. $ecei%er can process data in initel! ast. Assumption &. 'hannel ne%er looses data

(ender sends as ast as possible

$ecei%er can alwa!s process ast enough

imple" stop-and-wait protocol


Assumption &. 'hannel ne%er looses data (ender sends rame

(ender waits or ack

$c%r sends ack a ter processing

(ender sends rame

Sim"le8 "rotocol for noisy channel


Assum"tion (& $hannel may loose data /ata frame can be lost E #ck can be lost 1ost data frames: This means that sender will never get an ack. ender can implement timer for each frame sent. %f timer e"pires retransmit. Duplicate frame at sender. $se se0uence numbers.

imple" protocol for noisy channel


ince we are still using a stop-and-wait type protocol! sender will never transmit frame mO1 unless it gets an ack for m. o receiver need only distinguish between successive frames. # 1 bit se0uence number ,5!1- is enough. ender includes consecutive se0 numbers in frame! receiver sends ack with se0 number.

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

# 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.

.&2&' A 5ne-*it Sliding /indow Protocol


Algorithm for sliding window "rotocol
/* Protocol 4 (sliding window) is bidirectional. */ #define MAX3SEQ 1 /* must be 1 for protocol 4 */ typedef enum {frame3arrival, cksum3err, timeout} event3type; #include "protocol.h" void protocol4 (void) { seq3nr next3frame3to3send; /* 0 or 1 only */ seq3nr frame3expected; /* 0 or 1 only */ frame r, s; /* scratch variables */ packet buffer; /* current packet being sent */ event3type event; next3frame3to3send = 0; /* next frame on the outbound stream */ frame3expected = 0; /* frame expected next */ from3network3layer(&buffer); /* fetch a packet from the network layer */ s.info = buffer; /* prepare to send the initial frame */ s.seq = next3frame3to3send; /* insert sequence number into frame */ s.ack = 1 frame3expected; /* piggybacked ack */ to3physical3layer(&s); /* transmit the frame */ start3timer(s.seq); /* start the timer running */ while (true) { wait3for3event(&event); /* frame3arrival, cksum3err, or timeout */ if (event == frame3arrival) { /* a frame has arrived undamaged. */ from3physical3layer(&r); /* go get it */ if (r.seq == frame3expected) { /* handle inbound frame stream. */ to3network3layer(&r.info); /* pass packet to network layer */ inc(frame3expected); /* invert seq number expected next */ } if (r.ack == next3frame3to3send) { /* handle outbound frame stream. */ stop3timer(r.ack); /* turn the timer off */ from3network3layer(&buffer); /* fetch new pkt from network layer */ inc(next3frame3to3send); /* invert senders sequence number */ } } s.info = buffer; /* construct outbound frame */ s.seq = next3frame3to3send; /* insert sequence number into it */ s.ack = 1 frame3expected; /* seq number of last received frame */

to3physical3layer(&s); /* transmit a frame */ start3timer(s.seq); /* start the timer running */ } }


# 1-bit sliding window protocol.

.&2&( A Protocol 6sing :o *ack N

Pipelining and error control


Pipelining is fine ... but what if frames in the pipeline are lost. ender will detect loss of frames only after many successive frames have already been transmitted. o! does the sender retransmit all frames ,lost and successive- or 'ust lostW The buffer at the receiver decides.

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.

.&2&. A Protocol 6sing Selecti+e Re"eat


Protocol < works well if errors are rare! but if the line is poor! it wastes a lot of bandwidth on retransmitted frames. #n alternative strategy for handling errors is to allow the receiver to accept and buffer the frames following a damaged or lost one. uch a protocol does not discard frames merely because an earlier frame was damaged or lost. %n this protocol! both sender and receiver maintain a window of acceptable se0uence numbers. The sender+s window si.e starts out at 5 and grows to some predefined ma"imum! 6#NX *F. The receiver+s window! in contrast! is always fi"ed in si.e and e0ual to 6#NX *F. The receiver has a buffer reserved for each se0uence number within its fi"ed window. #ssociated with each buffer is a bit ,arrived- telling whether the buffer is full or empty. (henever a frame arrives! its se0uence number is checked by the function between to see if it falls within the window. %f so and if it has not already been received! it is accepted and stored. This action is taken without regard to whether or not it contains the ne"t packet e"pected by the network layer. )f course! it must be kept within the data link layer and not passed to the network layer until all the lower-numbered frames have already been delivered to the network layer in the correct order.

.&3&( The ,ata )ink )ayer in the Internet


The %nternet consists of individual machines ,hosts and routers- and the communication infrastructure that connects them. (ithin a single building! 1#2s are widely used for interconnection! but most of the wide area infrastructure is built up from point-to-point leased lines

###2The #oint-to-#oint #rotocol


The %nternet needs a point-to-point protocol for a variety of purposes! including router-to-router traffic and home user-to-% P traffic. This protocol is PPP ,Point-toPoint Protocol-! which is defined in A?: 1>>1 and further elaborated on in several other A?:s ,e.g.! A?:s 1>>2 and 1>>3-. PPP handles error detection! supports multiple protocols! allows %P addresses to be negotiated at connection time! permits authentication! and has many other features. PPP provides three features: 1. # framing method that unambiguously delineates the end of one frame and the start of the ne"t one. The frame format also handles error detection. 2. # link control protocol for bringing lines up! testing them! negotiating options! and bringing them down again gracefully when they are no longer needed. This protocol is called 1:P ,1ink :ontrol Protocol-. %t supports synchronous and asynchronous circuits and byte-oriented and bit-oriented encodings. 3. # way to negotiate network-layer options in a way that is independent of the network layer protocol to be used. The method chosen is to have a different 2:P ,2etwork :ontrol Protocol- for each network layer supported.

#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

*NIT III/ )*+,-) A''*(( .A/*$


-#%I*- &CC#SS !&(#) + CH&NN#! &!!,C&TI,N P),0!#- + -*!TIP!# &CC#SS P),T,C,!S + #TH#)N#T .I)#!#SS !&NS + 0*!#T,,TH. The key issue is how to determine who gets to use the channel when there is competition for it. (hen only a single channel is available! determining who should go ne"t is much harder. broadcast channels are sometimes referred to as multiaccess channels or random access channels. The protocols used to determine who goes ne"t on a multiaccess channel belong to a sublayer of the data link layer called the 6#: ,6edium #ccess :ontrol- sublayer. The 6#: sublayer is especially important in 1#2s! many of which use a multiaccess channel as the basis for communication. (#2s! in contrast! use point-to-point links! e"cept for satellite networks

=.1 The :hannel #llocation Problem


The central theme of this chapter is how to allocate a single broadcast channel among competing users. The traditional way of allocating a single channel! such as a telephone trunk! among multiple competing users is ?re0uency /ivision 6ultiple"ing ,?/6-. %f there are 2 users! the bandwidth is divided into 2 e0ualsi.ed portions each user being assigned one portion. ince each user has a private fre0uency band! there is no interference between users. (hen there are only a small and constant number of users! each of which has a heavy ,buffered- load of traffic ,e.g.! carriers+ switching offices-! ?/6 is a simple and efficient allocation mechanism. (hen the number of senders is large and continuously varying or the traffic is bursty! ?/6 presents some problems. %f the spectrum is cut up into 2 regions and fewer than 2 users are currently interested in communicating! a large piece of valuable spectrum will be wasted. %f more than 2 users want to

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.

2&'&( ,ynamic $hannel Allocation in )ANs and MANs

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.

1.2 -ulti le &cce"" Protocol"


The basic idea is applicable to any system in which uncoordinated users are competing for the use of a single shared channel. Two versions of #1)I# here: pure and slotted. They differ with respect to whether time is divided into discrete slots into which all frames must fit. Pure #1)I# does not re0uire global time synchroni.ation& slotted #1)I# does.

#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.

9fficiency of Pure Aloha =


1et [T[ be the time needed to transmit one frame on the channel! and [frame-time[ as a unit of time e0ual to T. 1et [7[ refer to the mean used in the Poisson distribution over transmission-attempt amounts that is! on average! there are 7 transmissionattempts per frame-time. 1et [t[ be the time at which the sender wants to send a frame. (e want to use the channel for one frame-time beginning at t! and so we need all other stations to refrain from transmitting during this time. 6oreover! we need the

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

Slotted &loha Channel /


lotted #loha does re0uire global time synchroni.ation.

9fficiency of Slotted Aloha $hannel =


#ssume that the sending stations has to wait until the beginning of a frame time ,one frame time is one time slot- and arrivals still follow Poisson /istribution! where they are assumed probabilistically independent: %n this case the vulnerable period is 'ust t time units. Then the Probability that k frames are generated in a frame time is effective:PkM,7Tk-E,eT-7-8k\ %n t time! the probability of .ero frames! PoMeT,-7- ?rom the above throughput becomes: M7PoM7E,eT-7-

$om"arison 5f Pure Aloha And Slotted Aloha=

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.

Aelative formulas for the #1)I#


Through"ut or $hannel 6tili-ation Pure #1) I# lott ed #1) I# Pro%a%ility of collision Pro%a%ility of success

=.2.2 :arrier ense 6ultiple #ccess Protocols


Protocols in which stations listen for a carrier ,i.e.! a transmission- and act accordingly are called carrier sense protocols $SMA= : 6# is a set of rules in which the devices attached to a network first determines whether the channel or carrier is in use or free and then act accordingly. #s in this 6#: protocol! the network devices or nodes before transmission senses the channel! therefore! this protocol is known as carrier sense multiple access protocol. 6ultiple #ccess indicates that many devices can connect to and share the same network and if a node transmits anything! it is heard by all the stations on the network.

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#.

2. Non2 er"i"tent CS-&/


The main difference between 1-persistent and non persistent carrier sense protocol is that in non-persistent if a station finds the channel busy! it waits random amount of time and starts retransmission again. :onse0uently! this algorithm leads to better channel utili.ation and reduces the chance of collisions but longer delays than 1persistent : 6#.

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

2&(&. $ollision-0ree Protocols


%f two or more stations sense the channel idle at about the same time! and begin transmitting the same time! the collision is sure.%n : 6#8:/ protocols! the stations abort their transmission as soon as they detect the collision. # station! after abortion waits a random period of time known as back-off delay and tries the same thing again.#bortion of collisions saves the bandwidth as in csma8cd! # 'am signal is sent due to which all transmitters stops transmissions by random intervals! reducing the probability of a collision after the first retry. : 6#8:/ can be in one of three states: -transmission! -contention! or -idle. 2ormally the csma8cd protocol follows the mechanism shown in the diagram below. %f two stations starts transmitting at the same time! a collision will occur which is detected by the power of the received pulse and then comparing it with the transmitted signal power. #fter the collision is detected!the station stops transmitting and waits random amount of time and then again starts transmitting assuming that no other station is transmitting in this time.This time slot can be regarded as contention slot. (hen no station is transmitting! the channel is idle.

#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-.

2&(&. $ollision-0ree Protocols


protocols that resolve the contention for the channel without any collisions at all! not even during the contention period. 6ost of these are not currently used in ma'or systems! but in a rapidly changing field! having some protocols with e"cellent properties available for future systems is often a good thing

/a+elength ,i+ision Multi"le Access Protocols


# different approach to channel allocation is to divide the channel into sub channels using ?/6! T/6! or both! and dynamically allocate them as needed # simple way to build an all-optical 1#2 is to use a passive star coupler%n effect! two fibers from each station are fused to a glass cylinder. )ne fiber is for output to the cylinder and one is for input from the cylinder. 1ight output by any station illuminates the cylinder and can be detected by all the other stations *ach channel is divided into groups of time slots! as shown in ?ig. =-15. 1et us call the number of slots in the control channel m and the number of slots in the data channel n O 1! where n of these are for data and the last one is used by the station to report on its status ,mainly! which slots on both channels are free-. )n both channels! the se0uence of slots repeats endlessly! with slot 5 being marked in a special way so latecomers can detect it. #ll channels are synchroni.ed by a single global clock.

Figure %-16. (a*elength di*ision multiple access.

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.

=.2.> (ireless 1#2 Protocols

Figure %-11. A wireless 3A7. &a' A transmitting. &b' ) transmitting.


?irst consider what happens when # is transmitting to B! as depicted in ?ig. =-11,a-. %f : senses the medium! it will not hear # because # is out of range! and thus falsely conclude that it can transmit to B. %f : does start transmitting! it will interfere at B! wiping out the frame from #. The problem of a station not being able to detect a potential competitor for the medium because the competitor is too far away is called the hidden station problem. 2ow let us consider the reverse situation: B transmitting to #! as shown in ?ig. =11,b-. %f : senses the medium! it will hear an ongoing transmission and falsely conclude that it may not send to /! when in fact such a transmission would cause bad reception only in the .one between B and :! where neither of the intended receivers is located. This is called the e"posed station problem.

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

2&.&' 9thernet $a%ling

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.

=.3.3 The *thernet 6#: ublayer Protocol


The original /%N ,/*:! %ntel! Nero"- frame structure is shown in ?ig. =-1L,a-. *ach frame starts with a Preamble of 9 bytes! each containing the bit pattern 15151515. The 6anchester encoding of this pattern produces a 15-6I. s0uare wave for >.= Ysec to allow the receiver+s clock to synchroni.e with the sender+s. They are re0uired to stay synchroni.ed for the rest of the frame! using the 6anchester encoding to keep track of the bit boundaries.

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.

2&3&' *luetooth Architecture


The basic unit of a Bluetooth system is a piconet! which consists of a master node and up to seven active slave nodes within a distance of 15 meters. 6ultiple piconets can e"ist in the same ,large- room and can even be connected via a bridge node! as shown in ?ig. =-3<. #n interconnected collection of piconets is called a scatternet. 0igure 2-.<& Two "iconets can %e connected to form a scatternet

=.>.2 Bluetooth #pplications


The Bluetooth ;1.1 specification names 13 specific applications to be supported and provides different protocol stacks for each one. $nfortunately! this approach leads to a very large amount of comple"ity! which we will omit here. The 13 applications! which are called profiles! are listed in ?ig. =-3>. By looking at them briefly now! we may see more clearly what the Bluetooth %7 is trying to accomplish.

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.

2&3&. The *luetooth Protocol Stack

Figure %- 9. The ,6!.18 *ersion of the )luetooth protocol architecture.


The bottom layer is the physical radio layer! which corresponds fairly well to the physical layer in the ) % and 952 models. %t deals with radio transmission and modulation. 6any of the concerns here have to do with the goal of making the system ine"pensive so that it can become a mass market item. The baseband layer is somewhat analogous to the 6#: sublayer but also includes elements of the physical layer. %t deals with how the master controls time slots and how these slots are grouped into frames. 2e"t comes a layer with a group of somewhat related protocols. The link manager handles the establishment of logical channels between devices! including power management! authentication! and 0uality of service. The logical link control adaptation protocol ,often called 12:#P- shields the upper layers from the details of transmission. %t is analogous to the standard 952 11: sublayer! but technically different from it. #s the names suggest! the audio and control protocols deal with audio and control! respectively. The applications can get at them directly! without having to go through the 12:#P protocol.

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.

2&3&? The *luetooth 0rame Structure


There are several frame formats! the most important of which is shown in ?ig. =-39. %t begins with an access code that usually identifies the master so that slaves within radio range of two masters can tell which traffic is for them. 2e"t comes a <=-bit header containing typical 6#: sublayer fields. Then comes the data field! of up to 2L== bits ,for a five-slot transmission-. ?or a single time slot! the format is the same e"cept that the data field is 2=5 bits.

Figure %- ,. A typical )luetooth data frame.