Network
Network
There is no generally accepted taxonomy into which all computer networks fit, but two dimensions stand out as
important: transmission technology and scale.
Тhere are two types of transmission technology that are in widespread use: broadcast links and point-to-point links.
Types of transmission technology
•Broadcast links
the communica.on channel is shared by all the machines on the network; packets sent by any machine are received
by all the others. 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. Broadcast systems usually also allow the
possibility of addressing a packet to all des.na.ons by using a special code in the address field. When a packet with
this code is transmiIed, it is received and processed by every machine on the network. This mode of opera.on is
called broadcas5ng. Some broadcast systems also support transmission to a subset of the machines, which known as
mul5cas5ng.
•Point-to-point links
Point-to-point links connect individual pairs of machines. To go from the source to the des.na.on 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. O]en mul.ple 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 some.mes called unicas5ng.
An alterna.ve criterion for classifying networks is by scale. Distance is importantas a classifica.on metric because
different technologies are used at different scales.
•Internetworks
Many networks exist in the world, o]en with different hardware and so]ware. People connected to one network
o]en want to communicate with people aIached to a different one. The fulfillment of this desire requires that
different, and frequently incompa.ble, networks be connected. A collec.on of interconnected networks is called an
internetwork or internet. The Internet uses ISP networks to connect enterprise
networks, home networks, and many other networks. Subnets, networks, and internetworks are o]en confused. The
term ‘‘subnet’’ makes the most sense in the context of a wide area network, where it refers to the collec.on of
routers and communica.on lines owned by the network operator. As an analogy, the telephone system consists of
telephone switching offices connected to one another by high-speed lines, and to houses and businesses by low-
speed lines. These lines and equipment, owned and managed by the telephone company, form the subnet of the
telephone system. The telephones themselves (the hosts in this analogy) are not part of the subnet. A network is
formed by the combina.on of a subnet and its hosts. However,the word ‘‘network’’ is o]en used in a loose sense as
well. A subnet might be described as a network, as in the case of the ‘‘ISP network’. talk about how two different
networks can be connected.
The general name for a machine that makes a connec.on between two or more networks and provides the
necessary transla.on, both in terms of hardware and so]ware, is a gateway. Gateways are dis.nguished by the layer
at which they operate in the protocol hierarchy.
Network SoYware
Since the benefit of forming an internet is to connect computers across networks, we do not want to use too low-
level a gateway or we will be unable to make connec.ons between different kinds of networks. We do not want to
use too high-level a gateway either, or the connec.on will only work for par.cular applica.ons.
The level in the middle that is ‘‘just right’’ is o]en called the network layer, and a router is a gateway that switches
packets at the network layer
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 func.on 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. This concept is actually a familiar one and is
used throughout computer science, where it is variously known as informa.on hiding, abstract data types, data
encapsula.on, and object oriented programming. The fundamental idea is that a par.cular piece of so]ware (or
hardware) provides a service to its users but keeps the details of its internal state and algorithms hidden from them.
When layer n on one machine carries on a conversa.on with layer n on another machine, the rules and conven.ons
used in this conversa.on are collec.vely known as the layer n protocol. Basically, a protocol is an agreement
between the communica.ng par.es on how communica.on is to proceed.
The en..es comprising the corresponding layers on different machines are called peers. The peers may be so]ware
processes, hardware devices, or even human beings. In other words, it is the peers that communicate by using the
protocol to talk to each other. 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 informa.on to the layer immediately below it, un.l the
lowest layer is reached. Below layer 1 is the physical medium through which actual communica.on occurs. virtual
communica.on is shown by doIed lines and physical communica.on by solid lines.
Between each pair of adjacent layers is an interface. The interface defines which primi.ve opera.ons and services
the lower layer makes available to the upper one. When network designers decide how many layers to include in a
network and what each one should do, one of the most important considera.ons is defining clean interfaces
between the layers. Doing so, in turn, requires that each
layer perform a specific collec.on of well-understood
func.ons. In addi.on to minimizing the amount of
informa.on that must be passed between layers, clearcut
interfaces also make it simpler to replace one layer with a
completely different protocol or implementa.on (e.g.,
replacing all the telephone lines by satellite channels)
because all that is required of the new protocol or
implementa.on is that it offer exactly the same set of
services to its upstairs neighbor as the old one did. It is
common that different hosts use different implementa.ons
of the same protocol (o]en wriIen by different companies).
In fact, the protocol itself can change in some layer without
the layers above and below it even no.cing. A set of layers
and protocols is called a network architecture. The
specifica.on
of an architecture must contain enough informa.on to allow
an implementer to write the program or build the hardware
for each layer so that it will correctly obey the appropriate
protocol. Neither the details of the implementa.on nor the specifica.on of the interfaces is part of the architecture
because these are hidden away inside the machines and not visible from the outside. It is not even necessary that
the interfaces on all machines in a network be the same, provided that each machine can correctly use all the
protocols. A list of the protocols used by a certain system, one protocol per layer, is called a protocol stack.
how to provide communica.on to the top layer of the five-layer network .A message, M, is produced by an
applica.on process running in layer 5 and given to layer 4 for transmission. Layer 4 puts a header in front of the
message to iden.fy the message and passes the result to
layer 3. The header includes control informa.on, such as
addresses, to allow layer 4 on the des.na.on machine to
deliver the message. Other examples of control
informa.on used in some layers are sequence numbers
(in case the lower layer does not preserve message
order), sizes, and .mes. In many networks, no limit is
placed on the size of messages transmiIed in the layer 4
protocol but there is nearly always a limit imposed by
the layer 3 protocol. Consequently, layer 3 must break up
the incoming messages into smaller units, packets,
prepending a layer 3 header to each packet. In this
example, M is split into two parts, M1 and M2, that will
be transmiIed 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 resul.ng 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. The important thing to
understand about Fig. 1-15 is the rela.on between the virtual and actual communica.on and the difference between
protocols and interfaces. The peer processes in layer 4, for example, conceptually think of their communica.on as
being ‘‘horizontal,’’ using the layer 4 protocol. Each one is likely to have procedures called something like
SendToOtherSide and GetFrom- OtherSide, even though these procedures actually communicate with lower layers
across the 3/4 interface, and not with the other side. The peer process abstrac.on is crucial to all network design.
Using it, the unmanageable task of designing the complete network can be broken into several smaller, manageable
design problems, namely, the design of the individual layers.
Design Issues for the Layers
1.Error control:Reliability is the design issue of making a network that operates correctly even though it is made up
of a collec.on of components that are themselves . Think about the bits of a packet traveling through the network.
There is a chance that some of these bits will be received damaged (inverted) due to fluke electrical noise, random
wireless signals, hardware flaws, so]ware bugs and so on. How is it possible that we find and fix these errors? One
mechanism for finding errors in received informa.on uses codes for error
detec5on. Informa.on that is incorrectly received can then be retransmiIed un.l it is received correctly. More
powerful codes allow for error correc5on,where the correct message is recovered from the possibly incorrect bits
that were originally received. Both of these mechanisms work by adding redundant informa.on. They are used at
low layers, to protect packets sent over individual links, and high layers, to check that the right contents were
received.
2.Rou5ng-Another reliability issue is finding a working path through a network. O]en there are mul.ple paths
between a source and des.na.on, and in a large network, there may be some links or routers that are broken.
Suppose that the network is down in Germany. Packets sent from London to Rome via Germany will not get through,
but we could instead send packets from London to Rome via Paris. The network should automa.cally make this
decision. This topic is called rou5ng.
3.Addressing -A second design issue concerns the evolu.on of the network. Over .me, networks grow larger and
new designs emerge that need to be connected to the exis.ng network. We have recently seen the key structuring
mechanism used to support change by dividing the overall problem and hiding implementa.on details: protocol
layering. There are many other strategies as well. Since there are many computers on the network, every layer needs
a mechanism for iden.fying the senders and receivers that are involved in a par.cular message. This mechanism is
called addressing or naming, in the low and high layers, respec.vely. An aspect of growth is that different network
technologies o]en have different limita.ons. For example, not all communica.on channels preserve the order of
messages sent on them, leading to solu.ons that number messages. Another example is differences in the maximum
size of a message that the networks can transmit. This leads to mechanisms for disassembling, transmilng, and then
reassembling messages. This overall topic is called internetworking. When networks get large, new problems arise.
Ci.es can have traffic jams, a shortage of telephone numbers, and it is easy to get lost. Not many people have these
problems in their own neighborhood, but citywide they may be a big issue. Designs that con.nue to work well when
the network gets large are said to be scalable.
3.Mul5plexing A third design issue is resource alloca.on. Networks provide a service to hosts from their underlying
resources, such as the capacity of transmission lines. To do this well, they need mechanisms that divide their
resources so that one host does not interfere with another too much. Many designs share network bandwidth
dynamically, according to the shorIerm needs of hosts, rather than by giving each host a fixed frac.on of the
bandwidth that it may or may not use. This design is called sta5s5cal mul5plexing, meaning sharing based on the
sta.s.cs of demand. It can be applied at low layers for a single link, or at high layers for a network or even
applica.ons that use the network.
4.Flow control:An alloca.on problem that occurs at every level is how to keep a fast sender from swamping a slow
receiver with data. Feedback from the receiver to the sender is o]en used. This subject is called flow control.
Some.mes the problem is that the network is oversubscribed because too many computers want to send too much
traffic, and the network cannot deliver it all. This overloading of the network is called conges5on. One strategy is for
each computer to reduce its demand when it experiences conges.on. It, too, can be used in all layers. It is interes.ng
to observe that the network has more resources to offer than simply bandwidth. For uses such as carrying live video,
the .meliness of delivery maIers a great deal. Most networks must provide service to applica.ons that want this
real-5me delivery at the same .me that they provide service to applica.ons that want high throughput. Quality of
service is the name given to mechanisms that reconcile these compe.ng demands. The last major design issue is to
secure the network by defending it against different kinds of threats. One of the threats we have men.oned
previously is that of eavesdropping on communica.ons. Mechanisms that provide confiden5ality defend against this
threat, and they are used in mul.ple layers. Mechanisms for authen5ca5on prevent someone from impersona.ng
someone else. They might be used to tell fake banking Web sites from the real one, or to let the cellular network
check that a call is really coming from your phone so that you will pay the bill. Other mechanisms for integrity
prevent surrep..ous changes to messages, such as altering ‘‘debit my account $10’’ to ‘‘debit my account $1000.’’
REFERENCE MODELS
Although the protocols associated with the OSI model are not used any more, the model itself is actually quite
general and s.ll valid, and the features discussed at each layer are s.ll very important.
The TCP/IP model has the opposite proper.es: the model itself is not of much use but the protocols are widely used.
The OSI Reference Model
The model is called the ISO OSI (Open Systems Interconnec5on) Reference Model because it deals with connec.ng
open systems—that is, systems that are open for communica.on with other systems. We will
The OSI model has seven layers. Note that the OSI model itself is not a network architecture because it does not
specify the exact services and protocols to be used in each layer. It just tells what each layer should do. However, ISO
has also produced standards for all the layers, although these are not part of the reference model itself. Each one has
been published as a separate interna.onal standard. The model (in part) is widely used although the associated
protocols have been long forgoIen
The Physical Layer
The physical layer is concerned with transmilng raw bits over a communica.on channel. The design issues have to
do with making sure that when one side sends a 1 bit it is received by the other side as a 1 bit, not as a 0 bit. Typical
ques.ons here are what electrical signals should be used to represent a 1 and a 0, how many nanoseconds a bit lasts,
whether transmission may proceed simultaneously in both direc.ons, how the ini.al connec.on is established, how
it is torn down when both sides are finished, how many pins the network connector has, and what each pin is used
for. These design issues largely deal with physical transmission medium, which lies below the physical layer.
The Data Link Layer
The main task of the data link layer is to transform a raw transmission facility into a line that appears free of
undetected transmission errors. It does so by masking the real errors so the network layer does not see them. It
accomplishes this task by having the sender break up the input data into data frames (typically
a few hundred or a few thousand bytes) and transmit the frames sequen.ally. If the service is reliable, the receiver
confirms correct receipt of each frame by sending back an acknowledgement frame.
Some traffic regula.on mechanism may be needed to let the transmiIer know when the receiver can accept more
data. Broadcast networks have an addi.onal issue in the data link layer: how to control access to the shared channel.
A special sublayer of the data link layer, the medium access control sublayer, deals with this problem.
The Network Layer
The network layer controls the opera.on of the subnet. A key design issue is determining how packets are routed
from source to des.na.on. Routes can be based on sta.c tables that are ‘‘wired into’’ the network and rarely
changed, or more o]en they can be updated automa.cally to avoid failed components. They
can also be determined at the start of each conversa.on, for example, a terminal session, such as a login to a remote
machine. Finally, they can be highly dynamic, being determined anew for each packet to reflect the current network
load.
If too many packets are present in the subnet at the same .me, they will get in one another’s way, forming
boIlenecks. Handling conges.on is also a responsibility of the network layer, in conjunc.on with higher layers that
adapt the load they place on the network. More generally, the quality of service provided (delay,
transit .me, jiIer, etc.) is also a network layer issue. When a packet has to travel from one network to another to get
to its des.na.on, many problems can arise. The addressing used by the second network may be different from that
used by the first one. The second one may not accept the packet at all because it is too large. The protocols may
differ, and so on. It is up to the network layer to overcome all these problems to allow heterogeneous networks to be
interconnected. In broadcast networks, the rou.ng problem is simple, so the network layer is o]en thin or even
nonexistent.
The Transport Layer
The basic func.on of the transport layer is to accept data from above it, split it up into smaller units if need be, pass
these to the network layer, and ensure that the pieces all arrive correctly at the other end. Furthermore, all this must
be done efficiently and in a way that isolates the upper layers from the inevitable changes in the hardware
technology over the course of .me. The transport layer also determines what type of service to provide to the
session layer, and, ul.mately, to the users of the network. The most popular type of transport connec.on is an error-
free point-to-point channel that delivers
messages or bytes in the order in which
they were sent. However, other possible
kinds of transport service exist, such as
the transpor.ng of isolated messages
with no guarantee about the order of
delivery, and the broadcas.ng of
messages to mul.ple des.na.ons. The
type of service is determined when the
connec.on is established.
The transport layer is a true end-to-end
layer; it carries data all the way from the
source to the des.na.on. In other
words, a program on the source
machine carries on a conversa.on with
a similar program on the des.na.on
machine, using the message headers
and control messages. In the lower
layers, each protocols is between a
machine and its immediate neighbors,
and not between the ul.mate source
and des.na.on machines, which may
be separated by many routers.
The Session Layer
The session layer allows users on
different machines to establish sessions
between them. Sessions offer various
services, including dialog control
(keeping track of whose turn it is to
transmit), token management (preven.ng two par.es from aIemp.ng the same cri.cal opera.on simultaneously),
and synchroniza5on (checkpoin.ng long transmissions to allow them to pick up from where they le] off in the event
of a crash and subsequent recovery).
The Presenta5on Layer
Unlike the lower layers, which are mostly concerned with moving bits around, the presenta5on layer is concerned
with the syntax and seman.cs of the informa.on transmiIed. In order to make it possible for computers with
different internal data representa.ons 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 presenta.on layer
manages these abstract data structures and allows higher-level data structures to be defined and exchanged.
The Applica5on Layer
The applica5on layer contains a variety of protocols that are commonly needed by users. One widely used
applica.on protocol is HTTP (HyperText Transfer Protocol), which is the basis for the World Wide Web. When a
browser wants a Web page, it sends the name of the page it wants to the server hos.ng the page using HTTP. The
server then sends the page back. Other applica.on protocols are used for file transfer, electronic mail, and network
news..
The TCP/IP Reference Model
Since applica.ons with divergent requirements were envisioned, ranging from transferring files to real-.me speech
transmission, a flexible architecture was needed.
The Link Layer
All these requirements led to the choice of a packet-switching network based on a connec.onless layer that runs
across different networks. The lowest layer in the model, the link layer describes what links such as serial lines and
classic Ethernet must do to meet the needs of this connec.onless internet layer. It is not really a layer at all, in the
normal sense of the term, but rather an interface between hosts and transmission links.
The Internet Layer
The internet layer is the linchpin that holds the whole architecture together. corresponding roughly to the OSI
network layer. Its job is to permit hosts to inject packets into any network and have them travel independently to the
des.na.on (poten.ally on a different network). They may even arrive in a completely different order than they were
sent, in which case it is the job of higher layers to rearrange them, if in-order delivery is desired. Note that ‘‘internet’’
is used here in a generic sense, even though this layer is present in the Internet. The internet layer defines an official
packet format and protocol called IP (Internet Protocol), plus a companion protocol called ICMP (Internet Control
Message Protocol) that helps it func.on. The job of the internet layer is to deliver IP packets where they are
supposed to go. Packet rou.ng is clearly a major issue here, as is conges.on (though IP has not proven effec.ve at
avoiding conges.on).
The Transport Layer
The layer above the internet layer in the TCP/IP model is now usually called the transport layer. It is designed to
allow peer en..es on the source and des.na.on hosts to carry on a conversa.on, just as in the OSI transport layer.
Two end-to-end transport protocols have been defined here. The first one, TCP (Transmission Control Protocol), is a
reliable connec.on-oriented protocol that allows a byte stream origina.ng on one machine to be delivered without
error on any other machine in the internet. It segments the incoming byte stream into discrete messages and passes
each one on to the internet layer. At the des.na.on, the receiving TCP process reassembles the received messages
into the output stream. TCP also handles flow control to make sure a fast sender cannot swamp a slow receiver with
more messages than it can handle. The second protocol in this layer, UDP (User Datagram Protocol), is an unreliable,
connec.onless protocol for applica.ons that do not want TCP’s sequencing or flow control and wish to provide their
own.
The Applica5on Layer
The TCP/IP model does not have session or presenta.on layers.
No need for them was perceived. Instead, applica.ons simply
include any session and presenta.on func.ons that they
require. Experience with the OSI model has proven this view
correct: these layers are of liIle use to most applica.ons. On
top of the transport layer is the applica5on layer. It contains all
the higher- level protocols. The early ones included virtual
terminal (TELNET), file transfer (FTP), and electronic mail
(SMTP). Many other protocols are addi.onaly added with years
like: include the Domain Name System (DNS), for mapping host
names onto their network addresses, HTTP, the protocol for
fetching pages on the World Wide Web, and RTP, the protocol for delivering real-.me media such as voice or movies.
A Comparison of the OSI and TCP/IP Reference Models
Both are based on the concept of a stack of independent protocols. Also, the func.onality of the layers is roughly
similar. For example, in both models the layers up through and including the transport layer are there to provide an
end-to-end, network- independent transport service to processes wishing to communicate. Again in both models, the
layers above transport are applica.on-oriented users of the transport service. Despite these fundamental similari.es,
the two models also have many differences.
Three concepts are central to the OSI model:
1. Services.
2. Interfaces.
3. Protocols.
Probably the biggest contribu.on of the OSI model is that it makes the dis.nc.on between these three concepts
explicit. Each layer performs some services for the layer above it. The service defini.on tells what the layer does, not
how en..es above it access it or how the layer works. It defines the layer’s seman.cs.
A layer’s interface tells the processes above it how to access it. It specifies what the parameters are and what results
to expect. It, too, says nothing about how the layer works inside. Finally, the peer protocols used in a layer are the
layer’s own business. It can use any protocols it wants to, as long as it gets the job done .These ideas fit very nicely
with modern ideas about object-oriented programming. An object, like a layer, has a set of methods (opera.ons)
that processes outside the object can invoke. The seman.cs of these methods define the set of services that the
object offers. The methods’ parameters and results form the object’s interface. The code internal to the object is its
protocol and is not visible or of any concern outside the object.
The TCP/IP model did not originally clearly dis.nguish between services, interfaces, and protocols,
For example, the only real services offered by the internet layer are SEND IP PACKET and RECEIVE IP PACKET. As a
consequence, the protocols in the OSI model are beIer hidden than in the TCP/IP model and can be
replaced rela.vely easily as the technology changes. Being able to make such changes transparently is one of the
main purposes of having layered protocols in the first place.
The OSI reference model was devised before the corresponding protocols were invented.
The downside of this ordering was that the designers did not have much experience with the subject and
did not have a good idea of which func.onality to put in which layer. For example, the data link layer originally dealt
only with point-to-point networks. When broadcast networks came around, a new sublayer had to be hacked into the
model.
With TCP/IP the reverse was true: the protocols came first, and the model was really just a descrip.on of the exis.ng
protocols. There was no problem with the protocols filng the model. They fit perfectly. The only trouble was that
the model did not fit any other protocol stacks. Consequently, it was not especially useful for describing other, non-
TCP/IP networks. Turning from philosophical maIers to more specific ones, an obvious difference between the two
models is the number of layers: the OSI model has seven layers and the TCP/IP model has four. Both have
(inter)network, transport, and applica.on layers, but the other layers are different. Another difference is in the area
of connec.onless versus connec.on-oriented communica.on. The OSI model supports both connec.onless and
connec.onoriented communica.on in the network layer, but only connec.on-oriented communica.on in the
transport layer, where it counts (because the transport service is visible to the users). The TCP/IP model supports
only one mode in the network layer (connec.onless) but both in the transport layer, giving the users a choice. This
choice is especially important for simple request-response protocols
A Critique of the OSI Model and Protocols
Neither the OSI model and its protocols nor the TCP/IP model and its protocols are perfect.They can be summarized
as:
1. Bad .ming.
2. Bad technology.
3. Bad implementa.ons.
4. Bad poli.cs.
Bad Timing
The .me at which a standard is established is absolutely cri.cal to its success. If they are wriIen too early (before
the research results are well established), the subject may s.ll be poorly understood; the result is a bad standard. If
they are wriIen too late, so many companies may have already made major investments in different ways of doing
things that the standards are effec.vely ignored. If the interval between the two elephants is very short (because
everyone is in a hurry to get started), the people developing the standards may get crushed. It now appears that the
standard OSI protocols got crushed. The compe.ng TCP/IP protocols were already in widespread use by research
universi.es by the .me the OSI protocols appeared.
Bad Technology
The choice of seven layers was more poli.cal than technical, and two of the layers (session and presenta.on) are
nearly empty, whereas two other ones (data link and network) are overfull.
The OSI model, along with its associated service defini.ons and protocols, is extraordinarily complex.
that to be effec.ve, error control must be done in the highest layer, so that repea.ng it over and over in each of the
lower layers is o]en unnecessary and inefficient.
Bad Implementa5ons
Given the enormous complexity of the model and the protocols, it will come as no surprise that the ini.al
implementa.ons were huge, unwieldy, and slow.
Bad Poli5cs
This belief was only partly true, but the very idea of a bunch of governmentbureaucrats trying to shove a technically
inferior standard down the throats of the poor researchers and programmers down in the trenches actually
developing computer networks did not aid OSI’s cause.
A Critique of the TCP/IP Reference Model
The TCP/IP model and protocols have their problems too. First, the model does not clearly dis.nguish the concepts of
services, interfaces, and protocols.
Good so]ware engineering prac.ce requires differen.a.ng between the specifica.on and the implementa.on,
something that OSI does very carefully, but TCP/IP does not. Consequently, the TCP/IP model is not much of a guide
for designing new networks using new technologies.
Second, the TCP/IP model is not at all general and is poorly suited to describing any protocol stack other than TCP/IP.
Trying to use the TCP/IP model to describe Bluetooth, for example, is completely impossible. Third, the link layer is
not really a layer at all in the normal sense of the term as used in the context of layered protocols. It is an interface
(between the network and data link layers). The dis.nc.on between an interface and a layer is crucial, and one
should not be sloppy about it. Fourth, the TCP/IP model does not dis.nguish between the physical and data link
layers. These are completely different. The physical layer has to do with the transmission characteris.cs of copper
wire, fiber op.cs, and wireless communica.on.
The data link layer’s job is to delimit the start and end of frames and get them from one side to the other with the
desired degree of reliability. A proper model should include both as separate layers. The TCP/IP model does not do
this. Finally, although the IP and TCP protocols were carefully thought out and well implemented, many of the other
protocols were ad hoc.
EXAMPLE NETWORKS
1.5.1 The Internet
The Internet is not really a network at all, but a vast collec.on of different networks that use
certain common protocols and provide certain common services. It is an unusual system in that
it was not planned by anyone and is not controlled by anyone.
The ARPANET
The story begins in the late 1950s. At the height of the Cold War, the U.S. wanted a command-
and-control network that could survive a nuclear war. At that .me, all military communica.ons
used the public telephone network, which was considered vulnerable. Here the black dots
represent telephone switching offices, each of which was connected to thousands of
telephones. These switching offices were, in turn, connected to higher-level switching offices
(toll offices), to form a na.onal hierarchy with only a small amount of redundancy. The
vulnerability of the system was that the destruc.on of a few key toll offices could fragment it
into many isolated islands
The subnet would consist of minicomputers called IMPs (Interface Message
Processors) connected by 56-kbps transmission lines. For high reliability, each IMP would be
connected to at least two other IMPs. The subnet was to be a datagram subnet, so if some lines
and IMPs were destroyed, messages could be automa.cally rerouted
along alterna.ve paths. Each node of the network was to consist of
an IMP and a host, in the same room, connected by a short wire. A
host could send messages of up to 8063 bits to its IMP, which would
then break these up into packets of at most 1008 bits and forward
them independently toward the des.na.on. Each packet was
received in its en.rety before being forwarded, so the subnet was the
first electronic store and- forward packet-switching network.
ARPA then put out a tender for building the subnet. The so]ware was
split into two parts: subnet and host. The subnet so]ware consisted
of the IMP end of the host-IMP connec.on, the IMP-IMP protocol, and a source IMP to des.na.on IMP protocol
designed to improve reliability. Outside the subnet, so]ware was also needed, namely, the host end of the host-IMP
connec.on, the host-host protocol, and the applica.on so]ware. It soon
became clear that BBN was of the opinion that when it had accepted a message on a host-IMP wire and placed it on
the host-IMP wire at the des.na.on, its job was done. This experiment also demonstrated that the exis.ng ARPANET
protocols were not suitable for running over different networks. This observa.on led to more research on protocols,
culmina.ng with the inven.on of the TCP/IP model and protocols (TCP/IP was specifically designed to handle
communica.on over internetworks, something becoming increasingly important as more and more networks were
hooked up to the ARPANET. LANs, were connected to the ARPANET. As the scale increased, finding hosts became
increasingly expensive, so DNS (Domain Name System) was created to organize machines into domains and map
host names onto IP addresses. Since then, DNS has become a generalized, distributed database system for storing a
variety of informa.on related to naming.
Architecture of the Internet
To join the Internet, the computer is connected to an Internet Service Provider, or simply ISP, from who the user
purchases Internet access or connec5vity. This lets the computer exchange packets with all of the other accessible
hosts on the Internet. The user might send packets to surf the Web or for any of a thousand other uses, it does not
maIer. There are many kinds of Internet access, and they are usually dis.nguished by how much bandwidth they
provide and how much they cost, but the most important aIribute is connec.vity. A common way to connect to an
ISP is to use the phone line to your house, in which case your phone
company is your ISP. DSL, short for Digital Subscriber Line, reuses the
telephone line that connects to your house for digital data
transmission. The computer is connected to a device called a DSL
modem that converts between digital packets and analog signals that
can pass unhindered over the telephone line. At the other end, a
device called a DSLAM (Digital Subscriber Line Access Mul5plexer)
converts between signals and packets. The word modem is short for
‘‘modulator demodulator’’ and refers to any device that converts
between digital bits and analog signals. Another method is to send
signals over the cable TV system. Like DSL, this is a way to reuse
exis.ng infrastructure, in this case otherwise unused cable TV
channels. The device at the home end is called a cable modem and
the device at the cable headend is called the CMTS (Cable Modem Termina5on System). At the top of the food chain
are a small handful of companies, that operate large interna.onal backbone networks with thousands of routers
connected by high-bandwidth fiber op.c links. These ISPs do not pay for transit. They are usually called 5er 1 ISPs
and are said to form the backbone of the Internet, since everyone else must connect to them to be able to reach the
en.re Internet.
Companies that provide lots of content, such as Google and Yahoo!, locate their computers in data centers that are
well connected to the rest of the Internet. These data centers are designed for computers, not humans, and may be
filled with rack upon rack of machines called a server farm. Coloca5on or hos5ng data centers let customers put
equipment such as servers at ISP POPs so that short, fast connec.ons can be made between the servers and the ISP
backbones. The Internet hos.ng industry has become increasingly virtualized so that it is now common to rent a
virtual machine that is run on a server farm instead of installing a physical computer. These data centers are so large
(tens or hundreds of thousands of machines) that electricity is a major cost, so data centers are some.mes built in
areas where electricity is cheap
Wireless LANs: 802.11
The prolifera.on of standards meant that a
computer equipped with a brand X radio would
not work in a room equipped with a brand Y
base sta.on. In the mid 1990s, the industry
decided that a wireless LAN standard might be a
good idea, so the IEEE commiIee that had
standardized wired LANs was given the task of
drawing up a wireless LAN standard. All the
other LAN standards had numbers like 802.1,
802.2, and 802.3, up to 802.10, so the wireless
LAN standard was dubbed 802.11. A common
slang name for it is WiFi but it is an important
standard and deserves respect, so we will call it
by its proper name, 802.11. 802.11 networks
are made up of clients, such as laptops and mobile phones, and infrastructure called APs (access points) that is
installed in buildings. Access points are some.mes called base sta5ons. The access points connect to the wired
network, and all communica.on between clients goes through an access point. It is also possible for clients that are
in radio range to talk directly, such as two computers in an office without an access point. This arrangement is called
an ad hoc network. It is used much less o]en than the access point mode. At the frequencies used for 802.11, radio
signals can be reflected off solid objects so that mul.ple echoes of a transmission may reach a receiver along
different paths. The echoes can cancel or reinforce each other, causing the received signal to fluctuate greatly. This
phenomenon is called mul5path fading, The key idea for overcoming variable wireless condi.ons is path diversity, or
the sending of informa.on along mul.ple, independent paths
Physical layer
Informa.on can be transmiIed on wires by varying some physical property such as voltage or current. By
represen.ng the value of this voltage or current as a single-valued func.on of .me, f(t), we can model the behavior
of the signal and analyze it mathema.cally In the early 19th century, the French mathema5cian Fourier proved that
any reasonably behaved periodic func.on, g(t) with period T, can be constructed as the sum of a (possibly infinite)
number of sines and cosines
Bandwidth limited signal - No transmission
facility can transmit signals without losing some
power in the process. If all the Fourier
components were equally diminished, the
resul.ng signal would be reduced in amplitude
but not distorted [i.e., it would have the same
nice squared-off shape as Fig. 2-1(a)].
Unfortunately, all transmission facili.es diminish
different Fourier components by different
amounts, thus introducing distor.on. Usually, for
a wire, the amplitudes are transmiIed mostly
undiminished from 0 up to some frequency fc
[measured in cycles/sec or Hertz (Hz)], with all
frequencies above this cutoff frequency
aIenuated. The width of the frequency range
transmiIed without being strongly aIenuated is
called the bandwidth. In prac.ce, the cutoff is not
really sharp, so o]en the quoted bandwidth is
from 0 to the frequency at which the received
power has fallen by half. Signals that run from 0
up to a maximum frequency are called baseband
signals. Signals that are shi]ed to occupy a higher
range of frequencies, as is the case for all wireless
transmissions, are called passband signals. There
is much confusion about bandwidth because it
means different things to electrical engineers and
to computer scien.sts. To electrical engineers,
(analog) bandwidth is (as we have described
above) a quan.ty measured in Hz. To computer
scien.sts, (digital) bandwidth is the maximum
data rate of a channel, a quan.ty measured in
bits/sec. That data rate is the end result of using
the analog bandwidth of a physical channel for
digital transmission.
The Maximum Data Rate of a Channel
Nyquist proved that if an arbitrary signal has been
run through a low-pass filter of bandwidth B, the filtered signal can be completely reconstructed by making only 2B
(exact) samples per second. Sampling the line faster than 2B .mes per second is pointless because the higher-
frequency components that such sampling
could recover have already been filtered out. If random noise is present, the situa.on deteriorates rapidly. And there
is always random (thermal) noise present due to the mo.on of the molecules in the system. The amount of thermal
noise present is measured by the ra.o of the signal power to the noise power, called the SNR (Signal-to-Noise Ra5o).
If we denote the signal power by S and the noise power by N, the signal-to-noise ra.o is S/N. Usually, the ra.o is
expressed on a log scale as the quan.ty 10 log10 S /N because it can vary over a tremendous range. The units of this
log scale are called decibels (dB),
Error Control
By introducing .mers and sequencing. This possibility is dealt with by introducing .mers into the data link layer.
When the sender transmits a frame, it generally also starts a .mer. The .mer is set to expire a]er an interval long
enough for the frame to reach the des.na.on, 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
.mer runs out, in which case the .mer will be canceled. However, if either the frame or the acknowledgement is
lost, the .mer will go off, aler.ng the sender to a poten.al problem. The obvious solu.on is to just transmit the
frame again. However, when frames may be transmiIed mul.ple .mes there is a danger that the receiver will
accept the same frame two or more .mes and pass it to the network layer more than once. To prevent this from
happening, it is generally necessary to assign sequence numbers to outgoing frames, so that the receiver can
dis.nguish retransmissions from originals.
Flow Control
Another important design issue that occurs in the data link layer is what to do with a sender that systema.cally
wants to transmit frames faster than the receiver can accept them. This situa.on can occur when the sender is
running on a fast, powerful computer and the receiver is running on a slow, low-end machine. Clearly, something has
to be done to prevent this situa.on. Two approaches are commonly used. In the first one, feedback-based flow
control, the receiver sends back informa.on to the sender giving it permission to send more data, or at least telling
the sender how the receiver is doing. In 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
The parity bits are always on posi.on which is of power of 2, i.e 1,2,4,8 …. Parity 1 is
calculated by star.ng at posi.on one and taking an skipping one bit of the data. Parity
2 is calculated by star.ng at posi.on two and taking an skipping two bits of the data.
The same rules apply to 4,8… and all other parity bits. The parity bits are then sent
with the real data over the channel.
How to detect an error Recalculate the parity bits on the receiver’s side. If they match
than there is no error in the message. If they do not match just sum all those parity
bits and you will find the exact bit posi.on where the error ocured.
Stop – and – Wait protocol is for noiseless channel too. It provides unidirec.onal data transmission without any error
control facili.es. However, it provides for flow control so that a fast sender does not drown a slow receiver. The
receiver has a finite buffer size with finite processing speed. The sender can send a frame only when it has received
indica.on from the receiver that it is available for further data processing.
Sliding window protocols are data link layer protocols for reliable and sequen.al delivery of data frames. The sliding
window is also used in Transmission Control Protocol.
In this protocol, mul.ple frames can be sent by a sender at a .me before receiving an acknowledgment from the
receiver. The term sliding window refers to the imaginary boxes to hold frames. Sliding window method is also known
as windowing.
n one – bit sliding window protocol, the size of the
window is 1. So the sender transmits a frame, waits for
its acknowledgment, then transmits the next frame.
Thus it uses the concept of stop and waits for the
protocol. This protocol provides for full – duplex
communica.ons. Hence, the acknowledgment is
aIached along with the next data frame to be sent by
piggybacking. The data frames to be transmiIed
addi.onally have an acknowledgment field, ack field
that is of a few bits length. The ack field contains the
sequence number of the last frame received without
error. If this sequence number matches with the
sequence number of the frame to be sent, then it is
inferred that there is no error and the frame is transmiIed. Otherwise, it is inferred that there is an error in the
frame and the previous frame is retransmiIed.
Since this is a bi-direc.onal protocol, the same algorithm applies to both the communica.ng par.es.
Go-Back-N protocol is a sliding window protocol. It is a mechanism to detect and control the error in datalink layer.
During transmission of frames between sender and receiver, if a frame is damaged, lost, or an acknowledgement is
lost then the ac.on performed by sender and receiver is
explained in the following content.
Damaged Frame
If a receiver receives a damaged frame or if an error occurs while
receiving a frame then, the receiver sends the NAK ( nega.ve
acknowledgement) for that frame along with that frame number,
that it expects to be retransmiIed. A]er sending NAK, the
receiver discards all the frames that it receives, a]er a damaged
frame. The receiver does not send any ACK (acknowledgement)
for the discarded frames. A]er the sender receives the NAK for
the damaged frame, it retransmits all the frames onwards the
frame number referred by NAK.
Lost frame
The receiver checks the number on each frame, it receives. If a
frame number is skipped in a sequence, then the receiver easily
detects the loss of a frame as the newly received frame is received out of sequence. The receiver sends the NAK for
the lost frame and then the receiver discards all the frames received a]er a lost frame. The receiver does not send
any ACK (acknowledgement) for that discarded frames. A]er the sender receives the NAK for the lost frame, it
retransmits the lost frame referred by NAK and also retransmits all the frames which it has sent a]er the lost frame.
Lost Acknowledgement
If the sender does not receive any ACK or if the ACK is lost or damaged in between the transmission. The sender
waits for the .me to run out and as the .me run outs, the sender retransmits all the frames for which it has not
received the ACK. The sender iden.fies the loss of ACK with the help of a .mer.
The ACK number, like NAK (nega.ve acknowledgement) number, shows the number of the frame, that receiver
expects to be the next in sequence. The window size of the receiver is 1 as the data link layer only require the frame
which it has to send next to the network layer. The sender window size is equal to ‘w’. If the error rate is high, a lot of
bandwidth is lost wasted.
Damaged frames
If a receiver receives a damaged frame, it sends the NAK for the frame in
which error or damage is detected. The NAK number, like in go-back-n
also indicate the acknowledgement of the previously received frames
and error in the current frame. The receiver keeps receiving the new
frames while wai.ng for the damaged frame to be replaced. The frames
that are received a]er the damaged frame are not be acknowledged
un.l the damaged frame has been replaced.
Lost Frame
As in a selec.ve repeat protocol, a frame can be received out of order and further they are sorted to maintain a
proper sequence of the frames. While sor.ng, if a frame number is skipped, the receiver recognize that a frame is
lost and it sends NAK for that frame to the sender. A]er receiving NAK for the lost frame the sender searches that
frame in its window and retransmits that frame. If the last transmiIed frame is lost then receiver does not respond
and this silence is a nega.ve acknowledgement for the sender.
Lost Acknowledgement
If the sender does not receive any ACK or the ACK is lost or damaged in between the transmission. The sender waits
for the .me to run out and as the .me run outs, the sender retransmit all the frames for which it has not received
the ACK. The sender iden.fies the loss of ACK with the help of a .mer.
PPP
point to point protocol is a data link layer protocol which is used to set up a direct connec.on between two
networking nodes. Below are some of the characteris.cs of PPP:
Characteristics of Point to Point Protocol
• As men.oned in the beginning, PPP resides at the layer two of the OSI model.
• This protocol supports other essen.als such as authen.ca.on, error detec.on, link quality monitoring,
load balancing, compression, etc.
PPP basically redefines the format of the frame to be exchanged between two devices. Once the format is set, both
of devices can exchange the packets easily.
Components of PPP
To make PPP a successful protocol, there are certain essen.al components which form the basic building blocks of
this protocol.
1. Encapsula.on
2. Link Control Protocol (LCP) and,
3. Network Control Protocol (NCP)
1. Encapsula5on in PPP
Point to point protocol encapsulates the network layer packets in its frames. The fact that PPP can encapsulate any
network layer packet makes PPP layer three protocol independent and also capable of carrying mul.ple Layer three
packets over a single link.
2. Link Control Protocol
Link Control Protocol is the second component of PPP. The main purpose of LCP is to build and maintain data-link
connec.ons. Below are some of the func.onali.es of this sub-protocol:
2.1 PPP Authen.ca.on
PPP uses its Authen.ca.on method to iden.fy the remote device.
Scenario
Let’s say there are two routers R1 and R2. R1 has some data for R2 and wants to send the same to R2. But before
sending the data, R1 just wants to make sure that the R2 is in Real “R2”. To authen.cate its genuineness, R1 will
ini.ate an authen.ca.on process in where R2 will have to prove its iden.ty.
There are two authen.ca.on methods that PPP uses for authen.ca.on:
• PAP (Password Authen.ca.on Protocol)
• CHAP (Challenge Handshake Authen.ca.on Protocol)
2.1.1 PAP (Password Authen.ca.on Protocol)
PAP authen.ca.on is a two steps process. It goes like this:
Scenario: Router two wants to authen.cate itself to router one.
• In step one, router two will authen.cate itself to router one by sending its username and password in
clear text.
• Upon receiving it, router one will check its database and match the creden.als.
• Upon matching the creden.als, router one will either accept or reject the router two request.
It should be noted that PAP authen.ca.on between two routers happens during the connec.on establishment only.
Once the connec.on is already set up, no more sequen.al authen.ca.on is done for that par.cular session.
2.1.2 CHAP (Challenge Handshake Authen.ca.on Protocol)
Unlike PAP, CHAP is not only used for the ini.al connec.on set up but also, sequen.al authen.ca.on is performed to
make sure that router is s.ll communica.ng with the same host. If any sequen.al authen.ca.on is failed, the
connec.on will be terminated immediately.
CHAP authen.ca.on is a three steps process. It goes like this (scenario remains the same as of PAP)
2.2 Compression
Link Control Protocol (LCP) uses compression to increase overall data transmission speed while saving bandwidth at
the same .me. LCP compresses data at the sending end and decompresses the same at the receiving end.
2.3 Error Detec.on
LCP u.lizes a tool called LQM (Link Quality Monitoring) to monitor different interfaces for their error percentage.
There is a threshold value that has been defined for each interface. If a faulty interface exceeds the threshold value,
LCP disables that interface.
2.4 Mul.link
LCP can combine two physical links logically in such a way that they seem a single logical connec.on at layer three,
i.e., the network layer. For example, if there are two connec.ons of 128 Kbps then mul.link will combine them in
such a way that at layer three, they appear as one 256 Kbps connec.on.
You can also think of mul.link as link aggrega.on technology. However, with the mul.link the chances of receiving
the packets out of order, because of the mul.ple links, become high.
2.5 Loop Detec.on
Point to point protocol is also famous for detec.ng the looped connec.ons. To detect a loop, a node, while sending
the PPP LCP messages, might also tag along with a magic number. If the line is looped, the node will get back its sent
magic number in return. Otherwise, the node gets the peer’s magic number.
3. Network Control Protocol (NCP)
We already know that PPP works in data link layer of the OSI model. The data which comes from the upper layers
such as Transport Layer or Network Layer has to be fully compa.ble with the PPP. For the same purpose, NCP was
discovered.