CNnnn m12
CNnnn m12
Course objectives:
● Fundamentals of data communication networks.
● Software and hardware interfaces
● Application of various physical components and protocols
● Communication challenges and remedies in the networks.
The medium access control sublayer: The channel allocation problem, Multiple access protocols.
The Transport Layer: The Transport Service, Elements of transport protocols, Congestion control, The
internet transport protocols.
MODULE-5 8 Hours
Application Layer: Principles of Network Applications, The Web and HTTP, Electronic Mail in the Intern et,
DNS—The Internet’s Directory Service.
Module-I
INTRODUCTION
❖ Computer Network: A collection of autonomous computers interconnected by a single technology. Two
computers are said to be interconnected if they are able to exchange information. The connection need not
be via a copper wire; fiber optics, microwaves, infrared and communication satellites can also be used.
Networks come in many sizes, shapes and forms, as we will see later. They are usually connected together
to make larger networks, for example Internet.
NETWORK HARDWARE
❖ There is no generally accepted taxonomy into which all computer networks fit, but two dimensions stand out
as important: transmission technology and scale.
❖ There are two transmission technologies: Broadcast links and Point-to-Point links.
❖ Point-to-point links connect individual pairs of machines. To go from the source to the destination on a
network made up of point-to-point links, short messages, called packets in certain contexts, may have to first
visit one or more intermediate machines.
❖ Often multiple routes of different lengths are possible, so finding good ones is important in point-to-point
networks.
❖ Point-to-point transmission with exactly one sender and exactly one receiver is sometimes called unicasting.
Example browsing a website.
❖ Broadcast links: single communication channel shared by all machines, example wireless network.
❖ An address field within each packet specifies the intended recipient. Upon receiving a packet, a machine checks
the address field. If the packet is intended for the receiving machine, that machine processes the packet; if the
packet is intended for some other machine, it is just ignored.
❖ Some broadcast systems also support transmission to a subset of the machines, which known as
multicasting.
COMPUTER NETWORKS
❖ It is a privately owned network that operates within and nearby a single building like a home, office or factory.
4
COMPUTER NETWORKS
❖ When LANs are used by companies, they are called enterprise networks.
❖ Wireless LANs(IEEE 802.11) /Wireless Fidelity (WiFi): It is used in homes, older office buildings, cafeterias,
and other places where it is too much trouble to install cables.
❖ In these systems, every computer has a radio modem and an antenna that it uses to communicate with other
computers.
❖ An AP (Access Point), wireless router, or base station, relays packets between the wireless computers and also
between them and the Internet.
❖ Wireless LAN operates at a speed of 11 to 100’s Mbps.
❖ Wired LANs use a range of different transmission technologies. Most of them use copper wires, but some
use optical fiber. LANs are restricted in size, which means that the worst-case transmission time is bounded and
known in advance.
❖ Wired LANs run at speeds of 100 Mbps to 1 Gbps, have low delay and few errors. Newer LANs can operate
at up to 10 Gbps. It is just easier to send signals over a wire or through a fiber than through the air.
❖ The topology wired LANs is built from point-to-point links. IEEE 802.3, called Ethernet, is, by far, the most
common type of wired LAN. Fig. (b) Switched Ethernet. Each computer speaks the Ethernet protocol and
connects to a box called a switch with a point-to-point link. A switch has multiple ports, each of which can
connect to one computer. The job of the switch is to relay packets between computers that are attached to it,
using the address in each packet to determine which computer to send it to.
❖ Both wireless and wired broadcast networks can be divided into static and dynamic designs, depending on how
the channel is allocated.
❖ 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.
❖ Static 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).
❖ Dynamic allocation methods for a common channel are either centralized or decentralized.
❖ Centralized channel allocation: There is a single entity, for example, the base station in cellular networks,
which determines who goes next. It might do this by accepting multiple packets and prioritizing them according
to some internal algorithm.
5
COMPUTER NETWORKS
❖ Decentralized channel allocation: there is no central entity; each machine must decide for itself whether to
transmit.
❖ It covers a city and best-known example is cable television networks available in many cities. These systems
grew from earlier community antenna systems used in areas with poor over-the-air television reception. In those
early systems, a large antenna was placed on top of a nearby hill and a signal was then piped to the subscribers’
houses.
❖ At first, these were locally designed, ad hoc systems. The next step was television programming and even entire
channels designed for cable only. Often these channels were highly specialized, such as all news, all sports, all
cooking, all gardening, and so on.
❖ When the Internet began attracting a mass audience, the cable TV network operators began to realize that with
some changes to the system, they could pro- vide two-way Internet service in unused parts of the spectrum.
❖ In figure, both television signals and Internet being fed into the centralized cable headend for subsequent
distribution to people’s homes.
❖ Recent developments in high- speed wireless Internet access have resulted in another MAN, which has been
standardized as IEEE 802.16 and is popularly known as WiMAX
❖ VPN (Virtual Private Network): it provides flexible reuse of a resource (Internet connectivity).
❖ It has disadvantage, which is a lack of control over the underlying resources and mileage may vary with
internet speed.
❖ The subnet operator is known as a network service provider and the offices are its customers. The
subnet operator will connect to other customers too, as long as they can pay and it can provide service.
❖ A subnet operator is called an ISP (Internet Service Provider) and the subnet is an ISP network. Its
customers who connect to the ISP receive Internet service.
7
COMPUTER NETWORKS
❖ How the network makes the decision as to which path to use is called the routing algorithm.
❖ How each router makes the decision as to where to send a packet next is called the forwarding
algorithm.
❖ Examples of WAN make heavy use of wireless technologies i.e. satellite systems.
❖ The cellular telephone network is another example of a WAN that uses wireless technology.
❖ The first generation was analog and for voice only. The second generation was digital and for voice
only. The third generation is digital and is for both voice and data.
❖ Each cellular base station covers a distance much larger than a wireless LAN, with a range measured
in kilometers rather than tens of meters.
Internetworks:
❖ A collection of interconnected networks is called an internetwork or internet.
❖ The Internet uses ISP networks to connect enterprise networks, home networks, and many other
networks.
❖ There are two rules of thumb that are useful. First, if different organizations have paid to construct
different parts of the network and each maintains its part, we have an internetwork rather than a single
network.
❖ Second, if the underlying technology is different in different parts (e.g., broadcast versus point-to-
point and wired versus wireless), we probably have an internetwork.
❖ Gateways are distinguished by the layer at which they operate in the protocol hierarchy.
NETWORK SOFTWARE:
Protocol Hierarchies:
❖ To reduce their design complexity, most networks are organized 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.
❖ The purpose of each layer is to offer certain services to the higher layers while shielding those
layers from the details of how the offered services are actually implemented. In a sense, each layer is
a kind of virtual machine, offering certain services to the layer above it.
❖ When layer 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.
Basically, a protocol is an agreement between the communicating parties on how communication is to
proceed.
8
COMPUTER NETWORKS
❖ In reality, no data are directly transferred from layer n on one machine to layer n on another machine. Instead,
each layer passes data and control information to the layer immediately below it, until the lowestlayer is
reached.
❖ Below layer 1 is the physical medium through which actual communication occurs. Virtual communication is
shown by dotted lines and physical communication by solid lines.
❖ Interface: defines which primitive operations and services the lower layer makes available to the upper one.
❖ Clear- cut interfaces also make it simpler to replace one layer with a completely different protocol or
implementation.
❖ A set of layers and protocols is called network architecture. The specification of architecture must contain
enough information to allow an implementer to write the program or build the hardware for each layer so that
it will correctly obey the appropriate protocol.
❖ A list of the protocols used by a certain system, one protocol per layer, is called a protocol stack.
9
COMPUTER NETWORKS
❖ In this example, M is split into two parts, M 1 and M 2, that will be transmitted separately.
Layer 3 decides which of the outgoing lines to use and passes the packets to layer 2. Layer 2 adds to
each piece not only a header but also a trailer, and gives the resulting unit to layer 1 for physical
transmission.
❖ At the receiving machine the message moves upward, from layer to layer, with headers being stripped
off as it progresses. None of the headers for layers below n are passed up to layer n.
• Identifying senders and receivers - some form of addressing is needed in order to specify a
specific source and destination.
• Rules for data transfer - The protocol must also determine the direction of data flow, how
many logical channels the connection corresponds to and what their priorities are. Many
networks provide at least two logical channels per connection, one for normal data and one for
urgent data.
• Error control – when circuits are not perfect, both ends of the connection must agree on which
error-detecting and error-correcting codes is being used.
• Sequencing - protocol must make explicit provision for the receiver to allow the pieces to be
reassembled properly.
• Flow Control - how to keep a fast sender from swamping a slow receiver with data. This is
done by feedback-based (receiver to sender) or agreed-on transmission rate.
• Segmentation and reassembly - several levels are the inability of all processes to accept
arbitrarily long messages. It leads to mechanisms for disassembling, transmitting, and then
reassembling messages.
• Multiplexing and demultiplexing – to share the communication medium by several users.
• Routing - When there are multiple paths between source and destination, a route must be
chosen.
11
COMPUTER NETWORKS
analogy with telegram service, which also does not return an acknowledgement to the sender.
❖ First, the server executes LISTEN to indicate that it is prepared to accept in coming connections. A
common way to implement LISTEN is to make it a blocking system call. After executing the primitive,
the server process is blocked until a request for connection appears.
❖ Next, the client process executes CONNECT to establish a connection with the server. The CONNECT
call needs to specify who to connect to, so it might have a parameter giving the server’s address. Client
is suspended until there is a response.
❖ When the packet arrives at the server, the operating system sees that the packet is requesting a
connection. It checks to see if there is a listener, and if so it unblocks the listener. The server process
12
COMPUTER NETWORKS
REFERENCE MODELS
The OSI Reference Model
❖ This model is based on a proposal developed by the International Standards Organization (ISO) as a
first step toward international standardization of the protocols used in the various layers (Day and
Zimmermann, 1983).
❖ It was revised in 1995 (Day, 1995). The model is called the ISO OSI (Open Systems Interconnection)
Reference Model because it deals with connecting open systems—that is, systems that are open for
communication with other systems.
❖ The OSI model has seven layers. The principles that were applied to arrive at the seven layers
can be briefly summarized as follows:
1. A layer should be created where a different abstraction is needed.
13
COMPUTER NETWORKS
❖ If the service is reliable, the receiver confirms correct receipt of each frame by sending back an
acknowledgement frame.
❖ Another issue in the data link layer is how to keep a fast transmitter from drowning a slow
receiver in data. Some traffic regulation mechanisms are used.
❖ Medium access control sub layer deals with how to control access to the shared channel.
❖ This layer is concerned with the syntax and semantics of the information transmitted.
❖ In order to make it possible for computers with different internal data representations to communicate,
the data structures to be exchanged can be defined in an abstract way, along with a standard encoding
to be used ‘‘on the wire.’’
❖ The presentation layer manages these abstract data structures and allows higher-level data structures
15
COMPUTER NETWORKS
congestion).
1. Magnetic Media:
❖ One 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 DVDs), physically transport the tape or disks to
the destination machine, and read them back in again.
❖ Although this method is not as sophisticated as using a geosynchronous communication satellite, it is
often more cost effective, especially for applications in which high bandwidth or cost per bit
transported is the key factor.
❖ An industry-standard Ultrium tape can hold 800 gigabytes. A box 60 60 60 cm can hold about 1000
of these tapes, for a total capacity of 800 terabytes, or 6400 terabits (6.4 petabits).
❖ A box of tapes can be delivered anywhere in the United States in 24 hours by Federal Express and
other companies. The effective bandwidth of this transmission is 6400 terabits/86,400 sec, or a bit over
70 Gbps.
❖ If the destination is only an hour away by road, the bandwidth is increased to over 1700 Gbps. No
computer net- work can even approach this. Of course, networks are getting faster, but tape densities
are increasing, too.
❖ The cost of an Ultrium tape is around $40 when bought in bulk. A tape can be reused at least 10 times,
So the tape cost is maybe $4000 per box per usage.
2. Twisted Pairs
❖ A twisted pair consists of two insulated copper wires, typically about 1 mm thick. The wires are twisted
together in a helical form, just like a DNA molecule.
❖ Twisting is done because two parallel wires constitute a fine antenna. When the wires are twisted, the
waves from different twists cancel out, so the wire radiates less effectively.
❖ A signal is usually carried as the difference in voltage between the two wires in the pair. This provides
better immunity to external noise because the noise tends to affect both wires the same, leaving the
differential unchanged.
18
COMPUTER NETWORKS
❖ The most common application of the twisted pair is the telephone system.
❖ Twisted pairs can run several kilometers without amplification, but for longer distances the signal
becomes too attenuated and repeaters are needed.
❖ The bandwidth depends on the thickness of the wire and the distance traveled, but several
megabits/sec can be achieved for a few kilometers in many cases.
❖ Twisted-pair cabling comes in several varieties. A ‘‘Cat 5”category 5 twisted pair consists of two
insulated wires gently twisted together. Four such pairs are typically grouped in a plastic sheath to
protect the wires and keep them together.
❖ Links that can be used in both directions at the same time, like a two-lane road, are called full- duplex
links.
❖ links that can be used in either direction, but only one way at a time, like a single-track railroad line
are called half-duplex links.
❖ Links that allow traffic in only one direction, like a one-way street. They are called
simplex links.
❖ Cat 5 replaced earlier Category 3 cables, but has more twists per meter. More twists result in less
crosstalk and a better-quality signal over longer distances, making the cables more suitable for high-
speed computer communication, especially 100-Mbps and 1-Gbps Ethernet LANs.
❖ Category 6 or even Category 7 has more stringent specifications to handle signals with greater
band- widths.
3. Coaxial Cable
❖ It has better shielding and greater bandwidth than unshielded twisted pairs, so it can span longer
distances at higher speed.
❖ There are two kinds, one kind, 50-ohm cable, is commonly used when it is intended for digital
transmission from the start. The other kind, 75-ohm cable, is commonly used for analog transmission
and cable television.
❖ A coaxial 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.
19
COMPUTER NETWORKS
❖ The construction and shielding of the coaxial cable give it a good combination of high bandwidth
and excellent noise immunity. The bandwidth possible depends on the cable quality and length.
❖ Coaxial 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. Coax is still widely used for cable
television and metropolitan area networks, however.
4. Power Lines
❖ Power lines deliver electrical power to houses, and electrical wiring within houses distributes the power
to electrical outlets. Its been used by electricity companies for low-rate communication such as re-
mote metering for many years, as well in the home to control devices.
❖ Simply plug a TV and a receiver into the wall, which you must do anyway because they need power,
and they can send and receive movies over the electrical wiring.
❖ The difficulty with using household electrical wiring for a network is that it was designed todistribute
power signals.
❖ Electrical signals are sent at 50–60 Hz and the wiring attenuates the much higher frequency (MHz)
signals needed for high-rate data communication.
❖ Transient currents when appliances switch on and off create electrical noise over a wide range of
frequencies.
❖ Despite these difficulties, it is practical to send at least 100 Mbps over typical household electrical
wiring by using communication schemes that resist impaired frequencies and bursts of errors.
20
COMPUTER NETWORKS
5. Fiber Optics
❖ In contrast, the achievable bandwidth with fiber technology is in excess of 50,000 Gbps (50 Tbps)
and we are nowhere near reaching these limits.
❖ The current practical limit of around 100 Gbps is due to our inability to convert between electrical
and optical signals any faster.
❖ Fiber optics are used for long-haul transmission in network backbones, high-speed LANs and high-
speed Internet access such as FttH (Fiber to the Home).
❖ An optical transmission system has three key components: the light source, the transmission medium,
and the detector.
❖ Conventionally, a pulse of light indicates a 1 bit and the absence of light indicates a 0 bit. The
transmission medium is an ultra-thin fiber of glass. The detector generates an electrical pulse when
light falls on it.
Optical fibers are made of glass, which, in turn, is made from sand, an in expensive raw material
available in unlimited amounts.
Fiber Cables:
❖ Fiber optic cables are similar to coax, except without the braid. At the center is the glass core through
which the light propagates. In multimode fibers, the core is typically 50 microns in diameter, about the
thickness of a human hair. In single-mode fibers, the core is 8 to 10 microns.
❖ The core is surrounded by a glass cladding with a lower index of refraction than the core, to keep all
the light in the core. Next comes a thin plastic jacket to protect the cladding. Fibers are typically
grouped in bundles, protected by an outer sheath.
WIRELESS TRANSMISSION
The Electromagnetic Spectrum
❖ When electrons move, they create electromagnetic waves that can propagate through space. These
waves were predicted by the British physicist James Clerk Maxwell in 1865 and first observed by the
German physicist Heinrich Hertz in 1887.
❖ The number of oscillations per second of a wave is called its frequency, f, and is measured in Hz.
The distance between two consecutive maxima (or minima) is called the wavelength λ(lambda).
21
COMPUTER NETWORKS
❖ When an antenna of the appropriate size is attached to an electrical circuit, the electromagnetic
waves can be broadcast efficiently and received by a receiver some distance away.
❖ In a vacuum, all electromagnetic waves travel at the same speed, no matter what their frequency as
called speed of light, c, is approximately 3*108 m/sec, or about 1 foot (30 cm) per nanosecond.
❖ The fundamental relation between f, λ, and c (in a vacuum) is λ f=c
Radio Transmission
❖ Radio frequency (RF) waves are easy to generate, can travel long distances, and can penetrate buildings
easily, so they are widely used for communication, both indoors and outdoors.
❖ Radio waves also are omnidirectional, meaning that they travel in all directions from the source, so the
transmitter and receiver do not have to be carefully aligned physically.
❖ The properties of radio waves are frequency dependent. At low frequencies, radio waves passthrough
obstacles well, but the power falls off sharply with distance from the source at least as fast as1/r 2 in
air—as the signal energy is spread more thinly over a larger surface. This attenuation is called path
loss.
22
COMPUTER NETWORKS
Microwave Transmission
❖ Before fiber optics, for decades these microwaves formed the heart of the long-distance telephone
transmission system.
❖ In fact, MCI, one of AT&T’s first competitors after it was deregulated, built its entire system with
microwave communications passing between towers tens of kilometers apart. Even the company’s
name reflected this (MCI stood for Microwave Communications, Inc.).
❖ Microwaves travel in a straight line, so if the towers are too far apart, the earth will get in the way.
❖ Unlike radio waves at lower frequencies, microwaves do not pass through buildings well. In addition,
even though the beam may be well focused at the transmitter, there is still some divergence in space.
❖ The demand for more and more spectrum drives operators to yet higher frequencies. Bands up to 10
GHz are now in routine use, but at about 4 GHz a new problem sets in: absorption by water.
❖ Microwave communication is so widely used for long-distance telephone communication, mobile
phones, television distribution, and other purposes that a severe shortage of spectrum has developed.
❖ Microwave is also relatively inexpensive. Putting up two simple towers and putting antennas on each
one may be cheaper than burying 50 km of fiber through a congested urban area or up over a mountain,
and it may also be cheaper than leasing the telephone company’s fiber,
Infrared Transmission
❖ Unguided infrared waves are widely used for short-range communication. The remote controls used
for televisions, VCRs, and stereos all use infrared communication.
❖ On the other hand, the fact that infrared waves do not pass through solid walls well is also a plus. It
means that an infrared system in one room of a building will not interfere with a similar system in
adjacent rooms or buildings: you cannot control your neighbor’s television with your remote control.
❖ Furthermore, security of infrared systems against eavesdropping is better than that of radio systems
precisely for this reason.
❖ Infrared communication has a limited use on the desktop, for ex- ample, to connect notebookcomputers
and printers with the IrDA (Infrared Data Association) standard, but it is not a major player in the
communication game.
23
COMPUTER NETWORKS
Light Transmission
❖ Unguided optical signaling or free-space optics has been in use for centuries.
❖ Optical signaling using lasers is inherently unidirectional, so each end needs its own laser and its own
Photodetector. This scheme offers very high bandwidth at very low cost and is relatively secure
because it is difficult to tap a narrow laser beam.
❖ The laser’s strength, a very narrow beam, is also its weakness here. Aiming a laser beam 1 mm wide
at a target the size of a pin head 500 meters away requires the marksmanship of a latter-day Annie
Oakley.
❖ To add to the difficulty, wind and temperature changes can distort the beam and laser beams also
cannot penetrate rain or thick fog, although they normally work well on sunny days.
❖ Unguided optical communication may seem like an exotic networking technology today, but it might
soon become much more prevalent.
❖ Communicating with visible light in this way is inherently safe and creates a low-speed network in
the immediate vicinity of the display.
24
Computer Networks
MODULE – 2
The Data link layer
DATA LINK LAYER DESIGN ISSUES
➢ The data link layer uses the services of the physical layer to send and receive bits over communication channels.
Functions of data link layer include:
• Providing a well-defined service interface to the network layer.
• Dealing with transmission errors.
• Regulating the flow of data so that slow receivers are not swamped by 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. Each frame contains a frame header, a payload field for holding the packet,
and a frame trailer, as illustrated in Fig. 3-1. Frame management forms the heart of what the data link layer does.
1
Computer Networks
➢ 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.
➢ On the source machine is an entity (a process), in the network layer that hands some bits to the data link layer for
transmission to the destination.
➢ The job of the data link layer is to transmit the bits to the destination machine so they can be handed over to the
network layer there, as shown in Fig. 3-2(a). The actual transmission follows the path of Fig. 3-2(b)
received. Furthermore, it guarantees that each frame is received exactly once and that all frames are received in
the right order.
➢ When connection-oriented service is used, transfers go through three distinct phases.
▪ First, connection is established by having both sides initialize variables and counters needed to keep track of which
frames have been received and which ones have not.
▪ Second, one or more frames are actually transmitted.
▪ Third, connection is released, freeing up the variables, buffers, and other resources used to maintain the connection.
Framing
Data link layer breaks up the bit stream into discrete frames, compute a short token called a checksum for each frame,
and include the checksum in the frame when it is transmitted. (Checksum algorithms will be discussed later in
this chapter.) When a frame arrives at the destination, the checksum is recomputed. If 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.
Framing methods:
1. Byte count.
2. Flag bytes with byte stuffing.
3. Flag bits with bit stuffing.
4. Physical layer coding violations.
The first framing method uses a field in the header to specify the number of bytes in the frame. When the data link
layer at the destination sees the byte count, it knows how many bytes follow and hence where the end of the frame
is. This technique is shown in Fig. 3-3(a) for four small example frames of sizes 5, 5, 8, and 8 bytes, respectively.
The trouble with this algorithm is that the count can be garbled by a transmission error. For example, if the byte
count of 5 in the second frame of Fig. 3-3(b) becomes a 7 due to a single bit flip, the destination will get out of
synchronization. It will then be unable to locate the correct start of the next frame.
The second framing method gets around the problem of resynchronization after an error by having each frame start
and end with special bytes. Often the same byte, called a flag byte, is used as both the starting and ending
3
Computer Networks
delimiter. This byte is shown in Fig. 3-4(a) as FLAG. Two consecutive flag bytes indicate the end of one frame
and the start of the next. Thus, if the receiver ever loses synchronization it can just search for two flag bytes to
find the end of the current frame and the start of the next frame.
However, there is a still a problem we have to solve. It may happen that the flag byte occurs in the data, especially
when binary data such as photographs or songs are being transmitted. This situation would interfere with the
framing. One way to solve this problem is to have the sender’s data link layer insert a special escape byte (ESC)
just before each ‘‘accidental’’ flag byte in the data. Thus, a framing flag byte can be distinguished from one in
the data by the absence or presence of an escape byte before it. The data link layer on the receiving end re- moves
the escape bytes before giving the data to the network layer. This technique is called byte stuffing.
If an escape byte occurs in the middle of the data, it is also stuffed with an escape byte. At the receiver, the first escape
byte is removed, leaving the data byte that follows it (which might be another escape byte or the flag byte). Some
examples are shown in Fig. 3-4(b).
The third method of delimiting the bit stream gets around a disadvantage of byte stuffing, which is that it is tied to the
use of 8-bit bytes. Framing can be also be done at the bit level, so frames can contain an arbitrary number of bits
made up of units of any size. It was developed for the once very popular HDLC (High- level Data Link Control)
protocol. Each frame begins and ends with a special bit pattern, 01111110 or 0x7E in hexadecimal. This pattern
is a flag byte. When- ever the sender’s data link layer encounters five consecutive 1s in the data, it automatically
stuffs a 0 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. It also ensures a minimum densityof
transitions that help the physical layer maintain synchronization. USB (Universal Serial Bus) uses bit stuffing for
this reason.
When the receiver sees five consecutive incoming 1 bits, followed by a 0 bit,
it automatically destuffs (i.e., deletes) the 0 bit. Just as byte stuffing is completely transparent to the network layer in
both computers, so is bit stuffing. If the user data contain the flag pattern, 01111110, this flag is transmitted as
011111010 but stored in the receiver’s memory as 01111110. Figure 3-5 gives an example of bit stuffing.
With bit stuffing, the boundary between two frames can be unambiguously recognized by the flag pattern.
4
Computer Networks
The last method of framing is encoding of bits as signals often includes redundancy to help the receiver. This
redundancy means that some signals will not occur in regular data. For example, in the 4B/5B line code 4 data
bits are mapped to 5 signal bits to ensure sufficient bit transitions. This means that 16 out of the 32 signal
possibilities are not used. We can use some reserved signals to indicate the start and end of frames. In effect, we
are using ‘‘coding violations’’ to delimit frames. The beauty of this scheme is that, because they are reserved
signals, it is easy to find the start and end of frames and there is no need to stuff the data.
Many data link protocols use a combination of these methods for safety. A common pattern used for Ethernet and
802.11 is to have a frame begin with a well-defined pattern called a preamble. This pattern might be quite long
(72 bits is typical for 802.11) to allow the receiver to prepare for an incoming packet. The preamble is then
followed by a length (i.e., count) field in the header that is used to locate the end of the frame.
Error Control
Next task of Data link layer is to make sure all frames are eventually delivered to the network layer at the destination
and in the proper order.
The usual way to ensure reliable delivery is to provide the sender with some feedback about what is happening at the
other end of the line. If the sender receives a positive acknowledgement about a frame, it knows the frame has
arrived safely. On the other hand, a negative acknowledgement means that something has gone wrong and the
frame must be transmitted again.
But certain frames can go missing due to the introduction of some noise in the signal. If the acknowledgements are
lost, sender will not understand what to do. That is when the timers are useful. When the sender transmits a frame,
it generally also starts a timer. The timer is set to expire after an interval long enough for the frame to reach the
destination, be processed there, and have the acknowledgement propagate back to the sender. Normally, the frame
will be correctly received and the acknowledgement will get back before the timer runs out, in which case the
timer will be canceled.
During retransmissions receiver may get duplicate packets. To prevent this from happening, sequence numbers are
assigned to outgoing frames, so that the receiver can distinguish retransmissions from originals.
The whole issue of managing the timers and sequence numbers so as to ensure that each frame is ultimately passed to
the network layer at the destination exactly once, no more and no less, is an important part of the duties of the
data link layer (and higher layers)
Flow Control
Another important design issue that occurs in the data link layer (and higher layers as well) is what to do with a sender
that systematically wants to transmit frames faster than the receiver can accept them. Sender should send the data
5
Computer Networks
at the same speed as the receiver is capable of receiving. Otherwise, receiver will lose couple of frames.
Two approaches are commonly used.
1. 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.
2. 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.
If one bit or any odd no bits is erroneously inverted during Transmission, the Receiver will detect an error. How ever
if two or even no of bits are inverted an undetected error occurs.
Ex 3. The Transmitted data is 10011010. The received data is 11011010.
Let both the transmitter and receiver are agreed on EVEN parity. Now an error will be detected, since the no of ones
received are ODD
The received data is wrong even though the no of ones are EVEN. Since two bits are inverted error can’t be detected.
6
Computer Networks
Ci=bi1+bi2+ +bin
In this format the parity bits at the end of each character are referred to as The Vertical Redundancy Check (VRC)
and the Parity check character is referred to as the Longitudinal Redundancy Check (LRC).
CRC Method
1. The frame is expressed in the form of a Polynomial F(x).0 1 1 1 1 1 1 0
2. Both the sender and receiver will agree upon a generator polynomial G(x) in advance.
3. Let ‘r’ be the degree of G(x). Append ‘r’ zero bits to the lower – order end of frame now it
contains m+r bits.
7
Computer Networks
1. Divide T(x) by G(x) at the receiver end. If the result is a zero, then the frame is transmitted correctly. Ex. Frame:
1101011011
Generator: 10011
8
Computer Networks
HAMMING CODES
Hamming codes provide another method for error correction. Error bits, called Hamming bits, are inserted into
message bits at random locations. It is believed that the randomness of their locations reduces the odds that these
Hamming bits themselves would be in error. This is based on a mathematical assumption that because there are
so many more message bits compared with Hamming bits, there is a greater chance for a message bit to be in
error than for a Hamming bit to be wrong. Determining the placement and binary value of the Hamming bits can
be implemented using hardware, but it is often more practical to implement them using software. The numberof
bits in a message (M) are counted and used to solve the following equation to determine the number of Hamming
bits (H) to be used:
2H ≥ M + H + 1
Once the number of Hamming bits is determined, the actual placement of the bits into the message is performed. It is
important to note that despite the random nature of the Hamming bit placements, the exact sample placements
9
Computer Networks
must be known and used by both the transmitter and receiver. Once the Hamming bits are inserted into their
positions, the numerical values of the bit positions of the logic 1 bits in the original message are listed. The
equivalent binary numbers of these values are added in the same manner as used in previous error methods by
discarding all carry results. The sum produced is used as the states of the Hamming bits in the message. The
numerical difference between the Hamming values transmitted and that produced at the receiver indicates the bit
position that contains a bad bit, which is then inverted to correct it.
H = ? M = 14 to satisfy this equation H should be 5 i.e. 5 hamming code bits should be incorporated
in the data bits.
1001000110H0H1H0H1H
Now count the positions where binary 1’s are present. Add using mod 2 operation (Ex-OR). The result will give the
Hamming code at the transmitter end.
1’s position Binary equivalent
This Hamming code will be incorporated at the places of ‘H’ in the data bits and the data will be transmitted.
Let the receiver received the 12th bit as zero. The receiver also finds out the Hammingcode in the same way as
transmitter.
10
Computer Networks
The decimal equivalent for the binary is 12 so error is occurred at 12th place.
Protocols in the data link layer are designed so that this layer can perform its basic functions: framing, error control
and flow control. Framing is the process of dividing bit - streams from physical layer into data frames whose size
ranges from a few hundred to a few thousand bytes.
11
Computer Networks
Since the transmitter waits for Δt time for an Ack this protocol is called stop and wait protocol.
At this situation protocol fails because the receiver receives a duplicate frame and there is no way to find out whether
the receiver frame is original or duplicate. So the protocol fails at this situation.
Now what is needed is some way for the Rx to distinguish a frame and a duplicate. To achieve this, the sender has to
put a sequence number in the header of each frame it sends. The Rx can check the sequence number of each
arriving frame to see if it is a new frame or a duplicate.
12
Computer Networks
Here a question arises: What is the minimum number of bits needed for the sequence number? The ambiguity is
between a frame and its successor. A 1-bit sequence number (0 or 1) is therefore sufficient. At each
instant of time, the receiver excepts a particular sequence number next. Any arriving frame containing wrong
sequence number is rejected as a duplicate. When a frame containing the correct sequence number arrives, it is
accepted, passed to the network layer and then expected sequence number is incremented i.e. 0 becomes 1 and
one becomes 0. Protocols in which a sender waits for a positive ack before advancing to the next data item are
often called PAR (positive ack with retransmission) or ARQ (automatic repeat request).
6. Now A thinks that the Ack received is the ack of new frame F0 and A sends nextframe F1. So a frame
F0 is missed. At this situation this protocol fails.
PIGGY BACKING
In most practical situations there is a need of transmitting data in both directions. This can be achieved by full duplex
transmission. If this is done we have two separate physical circuits each with a ‘forward ‘ and ‘reverse’ channel.
In both cases, the reverse channel is almost wasted. To overcome this problem a technique called piggy backing
is used.
The technique of temporarily delaying outgoing acknowledgements so that they can be hooked onto the next outgoing
data frame is known as piggy backing.
However, piggybacking introduces a complication not present with separate acknowledgements. How long should the
data link layer wait longer than the sender’s timeout period, the frame will be retransmitted, defeating the whole
purpose of having acknowledgements. Of course, the data link layer cannot foretell the future, so it must resort to
some ad hoc scheme, such as waiting a fixed number of milli seconds. If a new packet arrives quickly, the
acknowledgement is piggy backed onto it; otherwise, if no new packet has arrived by the end of this time period,
the data link layer just sends a separate acknowledgement frame.
13
Computer Networks
The essence of all sliding window protocols is that at any instant of time, the sender maintains a set of sequence
numbers corresponding to frames it is permitted to send. These frames are said to fall with in the sending window.
Similarly 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 upperlimits, or even
have the same size. In some protocols they are fixed in size, but in others they can grow or shrink as frames are
sent and received.
The sequence numbers with in the sender’s window represent frames sent but as yet not acknowledged. Whenever a
new packet arrives from the network layer, it is given the next highest sequence number, and the upper edge of
the window is advanced by one. When an acknowledgement comes in, the lower edge is advanced by one. In this
way the continuously maintains a list of unacknowledged frames.
PIPELINING
1. Upto now we made the assumption that the transmission time required for a frame to arrive at the receiver
plusthe transmission time for the ack to come back is negligible.
2. Sometimes this is not true, when there is a long round trip propagation time is there.
14
Computer Networks
3. In these cases round trip propagation time can have important implications for the efficiency of the
bandwidthutilization.
Consider the below example.
Let the channel capacity b = 50Kbps.
round trip propagation delay = 500ms
Frame size = 1000bits
Without considering the round trip propagation delay
For one frame the time taken will be = 1000/500 ms = 20 ms
Considering the round trip propagation delay
For one frame the time taken will be = 500 ms +20 ms = 270 ms
The channel utilization = (20/520)*100 = 4%
i.e. We are wasting 96% of channel time. To overcome this problem we will go for a technique called
PIPELIING.
In this technique, the sender is allowed to transmit upto ‘w ‘ frames before blocking, instead of just 1.With an
appropriate choice of w the sender will be able to continuously transmit frames for a time equal to the round trip
transmit time without filling up the window.
By the time it has finished sending 26 frames, at t=520 ms, the ack for frame 0 will have just arrived. Thereafter ack
will arrive every 20 ms, so the sender always gets permission to continue just when it needs it. Hence, we can say
the sender window size is 26.
Derivation:
Let the channel capacity = b Bps
Due to round trip delay the time taken will be (l/b + R) Sec = l+Rb/b Sec
If l > bR the efficiency will be greater than 50%.If l < bR the efficiency will be less than 50%.
Ex 1. A channel has a bit rate of 4 kbps and a propagation delay of 20msec.For what rage of frame sizes does stop
and wait give an efficiency of at least 50 % ?
15
Computer Networks
2. Consider an error free 64 kbps channel used to send 512 –byte data frames in one direction, with very short
acknowledgements coming back the other way. What is the maximum throughput for window sizes of 1,7,15,and
127?
First, what happens if a frame in the middle of a long stream is damaged or lost? When a damaged frame arrives at
the receiver, it obviously should discarded, but what should the receiver do with all the correct frames following
it?
1. Go Back ‘n’
2. Selective repeat or Selective Reject
One way called in go back n, the receiver simply to discard all subsequent frames, sending no acknowledgements for
the discard frames. In the other words, the data link layer refuses to accept any frame except the next one it must
give to the network layer.
Selective Repeat:
The receiving data link layer store all the correct frames following the bad frame, not all itssuccessors. If the second
try succeeds the receiving data link layer will now have many correct frames in sequence, so they can all be
handed off to the network layer quickly andthe highest number acknowledged. This strategy corresponds to a
0 1 2 3 4 5 2 3 4 5 6 7 0
receiver window larger than 1.
0 1 E D D D 2 3 4 5 6
Discarded frames
Error
(a) Go-back-N
16
Computer Networks
b) Selective reject
- In broadcast network, the key issue is how to share the channel among several users.
-Broadcast channels are also called as multi-access channels or random access channels.
-Multi-access channel belong to a sublayer at the DL layer called the MAC sublayer.
-1970’s Norman Abramson end his colleagues devised this method, used ground –based radio broad costing. This is
called the ALOHA system.
-The basic idea, many users are competing for the use of a single shared channel.
-There are two versions of ALOHA: Pure and Slotted.
-Pure ALOHA does not require global time synchronization, where as in slotted ALOHA the time is divided into
discrete slots into which all frames must fit.
-Let users transmit whenever they have data to be sent.
-Senders will know through feedback property whether the frame is destroyed or not by listening
-If the frame was destroyed, the sender waits random amount of time and again sends the frame.
-The waiting time must be random otherwise the same frame will collide over and over.
17
Computer Networks
-Whenever two frames try to occupy the channel at the same time, there will be a collision and both will be
destroyed.
-Let us consider an infinite collection of interactive users sitting at their systems (stations).
-Let the ‘Frame time’ denotes the time required to transmit one fixed length frame.
-Assume that infinite populations of users are generating new frames according to possion distribution with mean
N frames per frame time.
-If N>1 users are generating frames at a higher rate than the channel can handle.
-In addition to new frames, the station also generates retransmission of frames.
-G> N
-Under all loads, the throughput S = GPo, where Po is the probability that a frame does not suffer a collision.
-A frame will not suffer a collision if no other frames are sent with one frame time of its start.
-If any other user has generated a frame between time to and to+t, the end of that frame will collide with the
beginning of the shaded frame.
18
Computer Networks
-Similarly, any other frame started b/w to+t and to+2t will bump into the end of the shaded frame.
-The probability that ‘k’ frames are generated during a given frame time is given by the possion distribution:
Pr[k] = Gke-G
k!
-In an interval two frame times long, the mean number at frames generated is 2G.
-The probability at no other traffic being initiated during the entire vulnerable period is given by
Po = e-2G
S= Ge-2G [S=GPo]
The Maximum through put occurs at G=0.5 with S=1/2e = 0.184
-In 1972, Roberts’ devised a method for doubling the capacity of ALOHA system.
-In this system the time is divided into discrete intervals, each interval corresponding to one frame.
19
Computer Networks
-One way to achieve synchronization would be to have one special station emit a pip at the start of each interval, like
a clock.
-In Roberts’ method, which has come to be known as slotted ALOHA, in contrast to Abramson’s pure ALOHA; a
computer is not permitted to send whenever a carriage return is typed.
-Since the vulnerable period is now halved, the of no other traffic during the same slot as our test frame is e-G which
leads to
S = Ge –G
Persistent CSMA
When a station has data to send, it first listens to the channel to see if any one else is transmitting at that moment. If
the channel is busy, the station waits until it become idle. When the station detects an idle channel, it transmits a
frame. If a collision occurs, the station waits a random amount of time and starts all over again. The protocol is
called 1- persistent also because the station transmits with a probability of 1 when it finds the channel idle.
The propagation delay has an important effect on the performance of the protocol. The longer the propagation delay
the worse the performance of the protocol.
Even if the propagation delay is zero, there will be collisions. If two stations listen the channel, that is idle at the same,
both will send frame and there will be collision.
In this, before sending, a station sense the channel. If no one else is sending, the station begins doing so it self.
However, if the channel is busy, the station does not continually sense it but it waits a random amount of time
and repeats the process.
This algorithms leads to better channel utilization but longer delays then 1-persistent CSMA.
With persistent CSMA, what happens if two stations become active when a third station is busy? Both wait for the
active station to finish, then simultaneously launch a packet, resulting a collision. There are two ways to handle
this problem.
P-persistent CSMA
The first technique is for a waiting station not to launch a packet immediately when the channel becomes idle, but
first toss a coin, and send a packet only if the coin comes up heads. If the coin comes up tails, the station waits
20
Computer Networks
for some time (one slot for slotted CSMA), then repeats the process. The idea is that if two stations are both
waiting for the medium, this reduces the chance of a collision from 100% to 25%. A simple generalization of the
scheme is to use a biased coin, so that the probability of sending a packet when the medium becomes idle is not
0.5, but p, where 0< p < 1. We call such a scheme P-persistent CSMA. The original scheme, where p=1, is thus
called 1-persitent CSMA.
Exponential backoff
The key idea is that each station, after transmitting a packet, checks whether the packet transmission was successful.
Successful transmission is indicated either by an explicit acknowledgement from the receiver or the absence of a
signal from a collision detection circuit. If the transmission is successful, the station is done. Otherwise, the station
retransmits the packet, simultaneously realizing that at least one other station is also contending for the medium.
To prevent its retransmission from colliding with the other station’s retransmission, each station backs off (that
is, idles) for a random time chosen from the interval [0,2*max-propagation_delay] before retransmitting its
packet. If the retransmission also fails, then the station backs off for a random time in the interval [0,4*
max_propagation_delay], and tries again. Each subsequent collision doubles the backoff interval length, until the
retransmission finally succeeds. On a successful transmission,the backoff interval is reset to the initial value.
We call this type of backoff exponential backoff.
CSMA/CA
In many wireless LANS, unlike wired LANS, the station has no idea whether the packet collided with another packet
or not until it receives an acknowledgement from receiver. In this situation, collisions have a greater effect on
performance than with CSMA/CD, where colliding packets can be quickly detected and aborted. Thus, it makes
sense to try to avoid collisions, if possible. CSMA/CA is basically p-persistence, with the twist that when the
medium becomes idle, a station must wait for a time called the interframe spacing or IFS before contending for a
slot. A station gets a higher priority if it is allocated smaller inter frame spacing.
When a station wants to transmit data, it first checks if the medium is busy. If it is, it continuously senses the medium,
waiting for it to become idle. When the medium becomes idle, the station first waits for an interframe spacing
corresponding to its priority level, then sets a contention timer to a time interval randomly selected in the range
[0,CW], where CW is a predefined contention window length. When this timer expires, it transmits a packet and
waits for the receiver to send an ack. If no ack is received, the packet is assumed lost to collision, and the source
tries again, choosing a contention timer at random from an interval twice as long as the one before(binary
exponential backoff). If the station senses that another station has begun transmission while it was waiting for the
expiration of the contention timer, it does not reset its timer, but merely freezer it, and restarts the countdown
when the packet completes transmission. In this way, stations that happen to choose a longer timer value get
higher priority in the next round of contention.
Collision-Free Protocols
A Bit-Map Protocol
In the basic bit-map method, each contention period consists of exactly N slots. If station0 has a frame to send, it
transmits a 1 bit during the zeroth slot. No other station is allowed to transmit during this slot. Regardless of what
station 0 does, station 1 gets the opportunity to transmit a 1during slot 1, but only if it has a frame queued. In
general, station j may announce the fact that it has a frame to send by inserting a 1 bit into slot j. after all N slots
have passed by, each station has complete knowledge of which stations with to transmit.
21
Computer Networks
Binary Countdown
A problem with the basic bit-map protocol is that the overhead is 1 bit per station. A station wanting to use the channel
now broadcasts its address as a binary bit string, starting with the high-order bit. All addresses are assumed to be
the same length. The bits in each address position from different stations are BOOLEAN ORed together. We will
call this protocol binary countdown. It is used in Data kit.
As soon as a station sees that a high-order bit position that is 0 in its address has been overwritten with a 1, it gives
up. For example, if station 0010,0100,1001, and 1010 are all trying to get the channel, in the first bit time the
stations transmit 0,0,1, and 1, respectively. Stations 0010 and 0100 see the 1 and know that a higher-numbered
station is competing for the channel, so they give up for the current round. Stations 1001 and 1010 continue.
The next bit is 0, and both stations continue. The next bit is 1, so station 1001 gives up. The winner is station 1010,
because it has the highest address. After winning the bidding, it may now transmit a frame, after which another
bidding cycle starts.
22
Computer Networks
The IEEE 802.3 is for a 1-persistent CSMA/CD LAN. Xerox built a 2.94 Mbps CSMA/CD system to connect over
100 personal workstations on 1-Km cable. This system was called Ethernet through which electromagnetic
radiation was once thought to propagate. Xerox DEC and Intel came with another standard for 100 Mbps Ethernet.
This differs from old one that it runs at speeds from 1 to 10 Mbps on various media. The second difference
between these two is in one header (802.3 length field is used for packet type in Ethernet).
23
Computer Networks
802.3 Cabling
Five types of cabling are commonly used, 10Base5 cabling called thick Ethernet, came first. It resembles a yellow
garden hose, with markings every 2.5 m to show where the taps go. Connections to it are generally made using
vampire taps, in which a pin is carefully forced halfway into the coaxial cable’s core. The notation 10Base5
means that it operates at 10 Mbps, uses baseband signaling, and can support segments of up to 500m.
The second cable type was 10Base2 or thin Ethernet, which, in contrast to the garden- hose-like thick Ethernet, bends
easily. Connections to it are made using industry standard BNC connectors to form T-junctions, rather than using
vampire taps. These are easier to use and more reliable. Thin Ethernet is much cheaper and easier to install, but it
can run for only 200m and can handle only 30 machines per cable segment.
Cable breaks, bad taps, or loose connectors can be detected by a devise called time domain reflectometry.
For 10Base5, 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. When a collision is detected, the transceiver also puts a special invalid signal on the
cable to ensure that all other transceivers also realize that a collision has occurred.
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.
With 10Base2, the connection to the cable is just a passive BNC T-junction connector. The transceiver electronics
are on the controller board, and each station always has its own transceiver.
With 10Base-T, there is no cable at all, just the hub (a box full of electronics). Adding or removing a station is simple
in this configuration, and cable breaks can be detected easily. The disadvantage of 10Base-T is that the maximum
cable run from the hub is only 100m, may be 150m if high-quality (category 5) twisted pairs are used. 10Base-
Tis becoming steadily more popular due to the ease of maintenance. 10Base-F, which uses fiber optics. This
alternative is expensive due to the cost of the connectors and terminators, but it has excellent noise immunity and
is the method of choice when running between buildings or widely separated hubs.
Each version of 802.3 has a maximum cable length per segment. To allow larger networks, multiple cables can be
connected by repeaters. A repeater is a physical layer device. It receives, amplifies, and retransmits signals in
both directions. As far as the software is concerned, a series of cable segments connected by repeaters is no
different than a single cable (except for some delay introduced by the repeater). A system may contain multiple
cable segments and multiple repeaters, but no two transceivers may be more than 2.5km apart and no path between
any two transceivers any traverse more than four repeaters.
24
Computer Networks
25
Computer Networks
I) Preamble:
Each frame start with a preamble of 7 bytes each containing a bit pattern 10101010.
This gives the destination address. The higher order bit is zero for ordinary address and 1for group address (Multi
casting). All bits are 1s in the destination field frame will be delivered to all stations (Broad casting).
The 46th bit (adjacent to the high-order bit) is used to distinguish local from global addresses.
V) Data field:
This contains the actual data that the frame contains.
VI) Pad:
Valid frame must have 64 bytes long from destination to checksum. If the frame size less than 64 bytes pad field is
used to fill out the frame to the minimum size.
VII) Checksum:
It is used to find out the receiver frame is correct or not. CRC will be used here.
26
Computer Networks
Switched Ethernet:
Gigabit Ethernet
802.3 frames do not have priorities, making them unsuited for real-time systems in which important frames should
not be held up waiting for unimportant frames. A simple system with a known worst case is a ring in which the
stations take turns sending frames. If there are n stations and it takes T sec to send a frame, no frame will ever
have to wait more than nT sec to be sent.
27
Computer Networks
Since the cable is inherently a broadcast medium, each station receives each frame, discarding those not addressed to
it. When a station passes the token, it sends a token frame specifically addressed to its logical neighbor in the ring,
irrespective of where that station is physically located on the cable. It is also worth noting that when stationsare
first powered on, they will not be in the ring, so the MAC protocol has provisions for adding stations to, and
deleting stations from, the ring. For the physical layer, the token bus uses the 75-ohm broadband coaxial cable
used for cable television. Both single and dual-cable systems are allowed, with or without head-ends.
The frame control field is used to distinguish data frames from control frames. Fro data frames, it carries the frame’s
priority. It can also carry an indicator requiring the destination station to acknowledge correct or incorrect receipt
of the frame.
For control frames, the frame control field is used to specify the frame type. The allowed types include token
passing and various ring maintenance frames, including the mechanism for letting new stations enter the
ring, the mechanism for allowing stations to leave the ring, and so on.
28
Computer Networks
Connecting devices
Bridges
LANS can be connected by devices called bridges, which operate in the data link layer. Bridges do not examine the
network layer header and can thus copy IP, IPX, and OSI packets equally well.
1. Many university and corporate departments have their own LANS, primarily to connect their own personal
computers, workstations, and servers. Since the goals of the various departments differ, different departments
choose different LANS, without regard to what other departments are doing. Sooner or later, there is a need
for interaction, so bridgesare needed.
2. The organization may be geographically spread over several buildings separated by considerable distances. It
may be cheaper to have separate LANS in each building and connect them with bridges and infrared links than
to run a single coaxial cable over the entire site.
3. It may be necessary to split what is logically a single LAN into separate LANS to accommodate the load. Putting
all the workstations on a single LAN- the total bandwidth needed is far too high. Instead multiple LANS
connected by bridges are used.
4. In some situations, a single LAN would be adequate in terms of the load, but the physical distance between the
most distant machines is too great (e.g., more than 2.5km for 802.3). Even if laying the cable is easy to do, the
29
Computer Networks
network would not work due to the excessively long round-trip delay. Only solution is to partition the LAN and
install bridges between the segments.
5. There is the matter of reliability. On a single LAN, a defective node that keeps outputting a continuous stream of
garbage will cripple the LAN. Bridges can be inserted at critical places, to prevent a single node which has gone
berserk from bringing down the entire system.
6. And last, bridges can contribute to the organization’s security. By inserting bridges at various places and
beingcareful not to forward sensitive traffic, it is possible to isolate parts of the network so that its traffic
cannot escape and fall into the wrong hands.
Types of Bridges
Simple Bridge
Simple bridges are the most primitive and least expensive type of bridge. A simple bridge links two segments and
contains a table that lists the addresses of all the stations included in each of them. Before a simple bridge can be
used, an operator must sit down and enter the addresses of every station. Whenever a new station is added, the
table must be modified. If a station is removed, the newly invalid address must be deleted. Installation and
maintenance of simple bridges are time-consuming and potentially more trouble than the cost savings are worth.
Transparent Bridge
A transparent, or learning, bridge builds its table of station addresses on its own as it performs its bridge functions.
When the transparent bridge is first installed, its table is empty . As it encounters each packet, it looks at both the
destination and the source addresses. It checks the destination to decide where to send the packet. If it does not
yet recognize the destination address, it relays the packet to all of the stations on both segments. It uses the source
address to build its table. As it reads the source address, it notes which side the packet came from and associates
that address with the segment to which it belongs. By continuing this process even after the table is complete, a
transparent bridge is also self-updating.
The routing procedure for an incoming frame depends on the LAN it arrives on (the source LAN) and the LAN its
destination is on (the destination LAN), as follows.
1) If destination and source LANS are the same, discard the frame.
2) If the destination and source LANS are different, forward the frame.
3) If the destination LAN is unknown, use flooding.
Two Parallel transparent bridges
30
Computer Networks
Bridges are normally installed redundantly, which means that two LANs may be connected by more than one bridge.
In this case, if the bridges are transparent bridges, they may create a loop, which means a packet may be going
round and round, from one LAN to another and back again to the first LAN. To avoid this situation, bridges today
use what is called the spanning tree algorithm.
31