CN Notes
CN Notes
A computer network is a set of connected computers. Computers on a network are called nodes.
Also a network host is a computer or other device connected to a computer network.
Networks Types:-
Network topology is defined as the logical connection of various computers in the network.
The six basic network topologies are: bus, ring, star, tree, mesh and hybrid.
A protocol is a set of rules that govern data communications. A protocol defines what is communicated,
how it is communicated, and when it is communicated. The key elements of a protocol are syntax,
semantics, and timing.
Point-to-Point
A point-to-point connection provides a dedicated link between two devices.
Multipoint
A multipoint (also called multidrop) connection is one in which more than two specific devices share a
single link.
Page 1
COMPUTER NETWORKS
THE INTERNET
The Internet has revolutionized many aspects of our daily lives. It has affected the way we do business
as well as the way we spend our leisure time. Count the ways you've used the Internet recently. Perhaps
you've sent electronic mail (e-mail) to a business associate, paid a utility bill, read a newspaper from a
distant city, or looked up a local movie schedule-all by using the Internet. Or maybe you researched a
medical topic, booked a hotel reservation, chatted with a fellow Trekkie, or comparison-shopped for a
car. The Internet is a communication system that has brought a wealth of information to our fingertips
and organized it for our use.
A Brief History
A network is a group of connected communicating devices such as computers and printers. An internet
(note the lowercase letter i) is two or more networks that can communicate with each other. The most
notable internet is called the Internet (uppercase letter I), a collaboration of more than hundreds of
thousands of interconnected networks. Private individuals as well as various organizations such as
government agencies, schools, research facilities, corporations, and libraries in more than 100 countries
use the Internet. Millions of people are users. Yet this extraordinary communication system only came
into being in 1969. In the mid-1960s, mainframe computers in research organizations were standalone
devices. Computers from different manufacturers were unable to communicate with one another. The
Advanced Research Projects Agency (ARPA) in the Department of Defense (DoD) was interested in
finding a way to connect computers so that the researchers they funded could share their findings,
thereby reducing costs and eliminating duplication of effort. In 1967, at an Association for Computing
Machinery (ACM) meeting, ARPA presented its ideas for ARPANET, a small network of connected
computers. The idea was that each host computer (not necessarily from the same manufacturer) would
be attached to a specialized computer, called an inteiface message processor (IMP). The IMPs, in tum,
would be connected to one another. Each IMP had to be able to communicate with other IMPs as well as
with its own attached host. By 1969, ARPANET was a reality. Four nodes, at the University of
California at Los Angeles (UCLA), the University of California at Santa Barbara (UCSB), Stanford
Research Institute (SRI), and the University of Utah, were connected via the IMPs to form a network.
Software called the Network Control Protocol (NCP) provided communication between the hosts. In
1972, Vint Cerf and Bob Kahn, both of whom were part of the core ARPANET group, collaborated on
what they called the Internetting Projec1. Cerf and Kahn's landmark 1973 paper outlined the protocols to
achieve end-to-end delivery of packets. This paper on Transmission Control Protocol (TCP) included
concepts such as encapsulation, the datagram, and the functions of a gateway. Shortly thereafter,
authorities made a decision to split TCP into two protocols: Transmission Control Protocol (TCP) and
Internetworking Protocol (lP). IP would handle datagram routing while TCP would be responsible for
higher-level functions such as segmentation, reassembly, and error detection. The internetworking
protocol became known as TCP/IP
Page 2
COMPUTER NETWORKS
private companies, not the government. Figure shows a conceptual (not geographic) view of the
Internet.
Page 3
COMPUTER NETWORKS
connected to regional ISPs or directly to national ISPs. Most end users are connected to the local ISPs.
Note that in this sense, a local ISP can be a company that just provides Internet services, a corporation
with a network that supplies services to its own employees, or a non-profit organization, such as a
college or a university that runs its own network. Each of these local ISPs can be connected to a regional
or national service provider.
Layered Architecture
A monolithic network design that uses a single large body of hardware and software to meet all network
requirements can quickly become obsolete and also is extremely difficult and expensive to modify.
Layered approach accommodates incremental changes much more rapidly. It was developed to
accommodate changes in technology. Each layer of a specific network model may be responsible for a
different function of the network. Each layer will pass information up and down to the next subsequent
layer as data is processed.
The designers identified which networking functions had related uses and collected those functions into
discrete groups that became the layers. Each layer defines a family of functions distinct from those of
the other layers. By defining and localizing functionality in this fashion, the designers created an
architecture that is both comprehensive and flexible. Most importantly, the OSI model allows complete
interoperability between otherwise incompatible 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.
2. Each layer should perform a well-defined function.
3. The function of each layer should be chosen with an eye toward defining internationally
standardized protocols.
4. The layer boundaries should be chosen to minimize the information flow across the interfaces.
5. The number of layers should be large enough that distinct functions need not be thrown together
in the same layer out of necessity and small enough that the architecture does not become
unwieldy.
Page 4
COMPUTER NETWORKS
Page 5
COMPUTER NETWORKS
o some functions, e.g. error control, appear in several layers (data link, transport, application)
⇒ overall efficiency reduced
INTERNET STANDARDS
An Internet standard is a thoroughly tested specification that is useful to and adhered to by those who
work with the Internet. It is a formalized regulation that must be followed. There is a strict procedure by
which a specification attains Internet standard status. A specification begins as an Internet draft. An
Internet draft is a working document (a work in progress) with no official status and a six-month
lifetime. Upon recommendation from the Internet authorities, a draft may be published as a Request for
Comment (RFC). Each RFC is edited, assigned a number, and made available to all interested parties.
RFCs go through maturity levels and are categorized according to their requirement level.
Page 6
COMPUTER NETWORKS
Maturity Levels
An RFC, during its lifetime, falls into one of six maturity levels: proposed standard, draft standard,
Internet standard, historic, experimental, and informational. Proposed Standard. A proposed standard is
a specification that is stable, well understood, and of sufficient interest to the Internet community. At
this level, the specification is usually tested and implemented by several different groups.
Draft Standard. A proposed standard is elevated to draft standard status after at least two successful
independent and interoperable implementations. Barring difficulties, a draft standard, with modifications
if specific problems are encountered, normally becomes an Internet standard.
Internet Standard. A draft standard reaches Internet standard status after demonstrations of successful
implementation.
Historic The historic RFCs are significant from a historical perspective. They either have been
superseded by later specifications or have never passed the necessary maturity levels to become an
Internet standard.
Experimental An RFC classified as experimental describes work related to an experimental situation
that does not affect the operation of the Internet. Such an RFC should not be implemented in any
functional Internet service.
Informational An RFC classified as informational contains general, historical, or tutorial information
related to the Internet. It is usually written by someone in a non-Internet organization, such as a vendor.
Requirement Levels RFCs are classified into five requirement levels: required, recommended, elective,
limited use, and not recommended.
Required An RFC is labeled required if it must be implemented by all Internets systems to achieve
minimum conformance. For example, IF and ICMP are required protocols.
Recommended An RFC labeled recommended is not required for minimum conformance; it is
recommended because of its usefulness. For example, FTP and TELNET are recommended protocols.
Elective An RFC labeled elective is not required and not recommended. However, a system can use it
for its own benefit.
Limited Use An RFC labeled limited use should be used only in limited situations. Most of the
experimental RFCs fall under this category.
Not Recommended An RFC labeled not recommended is inappropriate for general use. Normally a
historic (deprecated) RFC may fall under this category.
INTERNET ADMINISTRATION
The Internet, with its roots primarily in the research domain, has evolved and gained a broader user base
with significant commercial activity. Various groups that coordinate Internet issues have guided this
growth and development. Fig shows the general organization of Internet administration.
The Internet Society (ISOC) is an international, nonprofit organization formed in 1992 to provide
support for the Internet standards process. ISOC accomplishes this through maintaining and supporting
other Internet administrative bodies such as lAB, IETF,IRTF, and IANA (see the following sections).
ISOC also promotes research and other scholarly activities relating to the Internet.
The Internet Architecture Board (IAB) is the technical advisor to the ISOC. The main purposes of the
lAB are to oversee the continuing development of the TCP/IP Protocol Suite and to serve in a technical
Page 7
COMPUTER NETWORKS
advisory capacity to research members of the Internet community. IAB accomplishes this through its
two primary components, the Internet Engineering Task Force (IETF) and the Internet Research Task
Force (IRTF). Another responsibility of the IAB is the editorial management of the RFCs, described
earlier. lAB is also the external liaison between the Internet and other standards organizations and
forums
The Internet Engineering Task Force (IETF) is a forum of working groups managed by the Internet
Engineering Steering Group (IESG). IETF is responsible for identifying operational problems and
proposing solutions to these problems. IETF also develops and reviews specifications intended as
Internet standards. The working groups are collected into areas, and each area concentrates on a specific
topic. Currently nine areas have been defined. The areas include applications, protocols, routing,
network management next generation, and security.
The Internet Research Task Force (IRTF) is a forum of working groups managed by the Internet
Research Steering Group (IRSG). IRTF focuses on long-term research topics related to Internet
protocols, applications, architecture, and technology
The OSI model appeared after the TCP/IP protocol suite. Most experts were at first excited and thought
that the TCP/IP protocol would be fully replaced by the OSI model . This did not happen due various
reasons.
Three most accepted reasons are First, OSI was completed when TCP/IP was fully in place and a lot of
time and money had been spent on the suite; changing it would cost a lot. Second, some layers in the
OSI model were never fully defined. For example, although the services provided by the presentation
and the session layers were listed in the document, actual protocols for these two layers were not fully
defined, nor were they fully described, and the corresponding software was not fully developed. Third,
Page 8
COMPUTER NETWORKS
when OSI was implemented by an organization in a different application, it did not show a high enough
level of performance to entice the Internet authority to switch from the TCP/IP protocol suite to the OSI
model.
The transmission media is broadly classified into two categories that are guided (Twisted pair cables,
coaxial cable, and optical fibre) and unguided media (radio waves, microwave, and infrared waves).
The basic difference between guided and unguided media is that in the guided media, the signal travels
through a physical medium whereas, in unguided media, the signal travel through the air.
Advantages
The cost of guided media is very low (inexpensive) and easily available.
This is very Flexible and Lightweight.
Very easy to set up and install.
Disadvantages
Bandwidth is very low in guided media.
Susceptible to interference and noise- (Noise is an electrical disturbance that can degrade
communication)
Page 9
COMPUTER NETWORKS
Page 10
COMPUTER NETWORKS
It takes place when one line (acting as a kind of receiving antenna) picks up some of the signals
travelling down another line (acting as a kind of sending antenna). this effect can be felt during
telephone discussion when one can hear other discussions in the background.
Coaxial cable
Coaxial cable (or coax) carries signals of higher frequency ranges than twisted-pair cable, in part
because the two media are constructed quite differently. rather than of having two wires, coax has a
central core conductor of solid or standard wire (usually copper) surrounded in an Insulating sheath,
which is, in turn, encased in an outer conductor of metal foil, braid, or a fusion of the two (also usually
copper).
The outer metallic enfold serves both as a shield against noise and as the second conductor, Which
completes the circuit. This outer conductor is also surrounded by an insulating sheath, and the entire
cable is secured by a plastic cover.
Optical Fibre
Up until this point, we have discussed conductive (metal) cables that transmit signals in the form of
current. Optical fibre, on the other hand, is made of glass or plastic and transmits signals in the form of
light. If we want to know and understand optical fibre, we first need to explore the nature of light.
Page 11
COMPUTER NETWORKS
The main functions and the design issues of this layer are
o Providing services to the network layer
o Framing
o Error Control
o Flow Control
Framing
The data link layer encapsulates each data packet from the network layer into frames that are then
transmitted.
A frame has three parts, namely −
o Frame Header
o Payload field that contains the data packet from network layer
o Trailer
Error Control
The data link layer ensures error free link for data transmission. The issues it caters to with respect to
error control are –
Page 12
COMPUTER NETWORKS
Flow Control
The data link layer regulates flow control so that a fast sender does not drown a slow receiver. When the
sender sends frames at very high speeds, a slow receiver may not be able to handle it. There will be
frame losses even if the transmission is error-free.
Descriptive Questions
1. What are the advantages of having layered architecture? Mention the layers of ISO-OSI
reference model?
2. What is Internet? Mention some of the applications of Internet?
3. Explain problems of the TCP/IP model and protocols?
4. With a neat diagram explain ARPANET design?
5. Write the advantages of optical fibre over twisted-pair and coaxial cables.
6. What are the advantages of having layered architecture?
7. Compare and contrast the OSI and TCP/IP reference models.
8. Discuss about the various transmission media available at the physical layer.
9. What is the use of data link layer?
10. Explain about various transmission media in physical layer with a neat sketch
11. Elaborate on the design issues of data link layer.
12. List Various Components in Network
13. List and define Network topologies
14. With neat diagram explain OSI reference model explain the functions performed at each layer.
15. How Internet is administered.
16. What are the issues in data link layer?
17. Compare OSI and TCP/IP reference model.
18. Discuss about Internet standards.
19. What is meant by protocol
20. Write any four reasons for using layered protocols.
21. Explain the functionality of each layer in OSI reference model.
22. Explain in brief about the design issues in the data link layer.
OBJECTIVE QUESTIONS
Page 13
COMPUTER NETWORKS
7. The___________ layer is responsible for the delivery of individual packets from the source host
to the destination host.
8. The ____________ layer is responsible for the delivery of a message from one process to
another
9. The _________ layer is responsible for moving frames from one hop (node) to the another
hop(Node). i.e. hop-to-hop delivery or node-to-node delivery
10. The ___________ layer is responsible for movements of individual bits from one node to the
next node.
12. TCP/IP is a hierarchical protocol . The term hierarchical means that each upper-level protocol is
supported by one or more lower-level protocols. [True / False]
21. How many layers are present in the Internet protocol stack (TCP/IP model)? _______
22. Which layer is used to link the network support layers and user support layers?
a) session layer b) data link layer c) transport layer d) network layer
23. The upper three layers, _______________ , ______________, ______________ are called user
support layers.
Page 14
COMPUTER NETWORKS
24. The lower three layers, _______________ , ______________, ______________ are called
network support layers.
Page 15
COMPUTER NETWORKS
COMPUTER NETWORKS
Page 16
COMPUTER NETWORKS
The Data Link Layer is the second layer of the OSI Model, its function is to transmit data within a
physical network link. It is considered a Reliable System to transmit data from one node to another
node.
Services to the Network Layer
The types of services provided can be of three types.
1. Unacknowledged connectionless service
2. Acknowledged connectionless service
3. Acknowledged connection - oriented service
1. Framing
The data link layer takes packages from the network layer and divides them into a few frames. Then it
bit by bit sends all these frames to the hardware. The data link layer then takes the signals from the
hardware and converts them into frames.
The Frame Contains
Frame Header
Payload field for holding packet
Frame Trailer
2. Error Control
Error Control is a process when the receiver's information does not match the information of the sender.
Then this process occurs. At the time of transmission, whenever a sender goes from Sender to receiver,
Digital Signal encounters the problem of Nodes which shows the error in Binary Bits. This means that 0
Bit will be converted into 1 Bit and 1 Bit will be converted to 0 Bit. The Data Link Layer uses two
methods to control the error.
Page 17
COMPUTER NETWORKS
3. Flow Control
Flow control is a technique. Which allows the two stations to communicate with each other and work at
different speeds? The data link layer regulates the flow control so that when a fast sender sends a data, a
slow receiver can receive the data at the same speed. For this, we use flow control. There are 2 common
approaches to control flow, even if the transmission is error free.
1. Feedback Based Flow Control: Sender transmits frame to receiver, sender transmits more frames after
it has received acknowledgments from receiver.
2. Rate Based Flow Control: When sender sends data at faster speed to receiver and receiver is not being
able to receive data at the speed, a built-in mechanism in protocol will just limit overall rate at which
data is being transferred by the sender without any acknowledgment from receiver.
Page 18
COMPUTER NETWORKS
Situation 1
Suppose if any frame sent is not received by the receiver and is lost. So the receiver will not send any
acknowledgment as it has not received any frame. So a deadlock situation arises here. To avoid any such
situation there is a time-out timer. The sender waits for this fixed amount of time for the
acknowledgment and if the acknowledgment is not received then it will send the frame again.
Situation 2
Consider a situation where the receiver has received the data and sent the acknowledgment but the ACK
is lost. So, again the sender might wait till infinite time if there is no system of time-out timer. So, in this
case also, the time-out timer will be used and the sender will wait for a fixed amount of time for the
acknowledgment and then send the frame again if the acknowledgement is not received.
Transmission Delay: Time taken by the sender to send all the bits of the frame onto the wire is called
transmission delay. This is calculated by dividing the data size(D) which has to be sent by the
bandwidth(B) of the link.
Td = D / B
Propagation Delay: Time taken by the last bit of the frame to reach from one side to the other side is
called propagation delay. It is calculated by dividing the distance between the sender and receiver by the
wave propagation speed.
Tp = d / s ; where d = distance between sender and receiver, s = wave propagation speed
Page 19
COMPUTER NETWORKS
The propagation delay for sending the data frame and the acknowledgment frame is the same as distance
and speed will remain the same for both frames. Hence, the total time required to send a frame is:
Total time= Td(Transmission Delay) + Tp(Propagation Delay for data frame) + Tp(Propagation Delay
for acknowledgment frame)
Total time=Td+ 2Tp
The sender is doing work only for Td time (useful time)and for the rest 2Tp time the sender is waiting
for the acknowledgment.
Efficiency
Efficiency = Useful Time/ Total Time
η = Td / (Td+2*Tp)
η = 1/(1+2a) →(1)
where a=Tp / Td
Throughput
The number of bits that a receiver can accept in total time duration (i.e. transmission time(Td) + 2 *
propagation delay(Tp)). It is also called effective bandwidth or bandwidth utilization.
In Stop and Wait, in the total duration, the receiver can accept only one frame. One frame is of data size
D i.e. D bits in one frame.
Page 20
COMPUTER NETWORKS
Page 21
COMPUTER NETWORKS
Point–to–Point Protocol (PPP) is a Communication Protocol of the Data Link Layer, which is used to
transmit Multi Protocol data between two Directly Connected (Point-to-Point) computers. It is a Byte -
Oriented Protocol widely used in Broadband Communications with heavy loads and high speed. Since it
is a data link layer protocol, the data is transmitted to the frame. It is also known as RFC 1661. PPP was
created by IETF (Internet Engineering Task Force). The main purpose of this was to create a data link
protocol for point to point links. This protocol can be used by anyone with Dial Up or ISDN.
Point to point is the non proprietary version of the HDLC protocol. You can also configure the Point to
Point protocol on Routers of Different Vendors. Point to Point Protocol is the most commonly used Data
Link Layer Protocol. This protocol connects your personal computer and ISP (Internet Service Provide
Components of PPP
The Point-to-Point Protocol is a Layered Protocol consisting of 4 components.
1. Encapsulation Component
It encapsulates the datagram so that it can be transmitted to the Specified Physica Layer.
Page 22
COMPUTER NETWORKS
PPP Frame
PPP is a Byte Oriented Protocol where each field of the frame contains one or more Bytes.
1. Flag Field: 1 byte that marks the beginning and the end of the frame.
2. Address Field: The address field is always set in this protocol. Its value is always 11111111.
3. Control Field: This field has a Fix Value set at 11000000. PPP does not provide flow control
service. Therefore, there is no need for this field.
4. Protocol Field: The Protocol field defines it. What type of data is placed in the data field.
5. Data Field: This is a length variable. It stores user data and other information. It carries data from
the network layer. The maximum length of a Data Field is 1500 Bytes. However, it may be
negotiated between endpoints of communication.
6. FCS Field: This is the frame check sequence. This is 2 Byte or 4 Byte Standard CRC (cyclic
redundancy code). It contains checksum.
Page 23
COMPUTER NETWORKS
A network connecting device can be a repeater, hub, bridge, switch, router, or gateway. But in this blog,
we'll focus on hubs, switches, routers, and gateways. We'll also learn about their features, advantages,
and disadvantages in networking.
All these connecting devices operate in some specific layers of the OSI(Open System Interconnection)
Model.
1. Hub
Hub is a very simple network connecting device. In Star/hierarchical topology, a Repeater is called Hub.
It is also known as a Multiport Repeater Device.
A Hub is a layer-1 device and operates only in the physical network of the OSI Model. Since it works in
the physical layer, it mainly deals with the data in the form of bits or electrical signals. A Hub is mainly
used to create a network and connect devices on the same network only.
Page 24
COMPUTER NETWORKS
A Hub is not an intelligent device, it forwards the incoming messages to other devices without checking
for any errors or processing it. It does not maintain any address table for connected devices. It only
knows that a device is connected to one of its ports.
When a data packet arrives at one of the ports of a Hub, it simply copies the data to every port. In other
words, a hub broadcasts the incoming data packets in the network. Due to this, there are various security
issues in the hub. Broadcasting also leads to unnecessary data traffic on the channel.
A Hub uses a half-duplex mode of communication. It shares the bandwidth of its channel with the
connecting devices. It has only one collision domain, so there are more chances of collision and traffic
on the channel. A hub is connected in limited network size. If the network size is increased, the speed of
the network will slow down. Also, a hub can only connect the devices in the same network with the
same data rates and format only.
2. Bridge
A bridge is a layer-2 network connecting device, i.e., it works on the physical and data-link layer of the
OSI model. It interprets data in the form of data frames. In the physical layer, the bridge acts as a
Repeater which regenerates the weak signals, while in the data-link layer, it checks the MAC(Media
Access Control) address of the data frames for its transmission.
Page 25
COMPUTER NETWORKS
A bridge connects the devices which are present in the same network. It is mainly used to segment a
network to allow a large network size. It has two types of port - incoming and outgoing. It uses the
incoming port to receive the data frames and outgoing port to send the data frames to other devices. It
has two collision domains, so there is still a chance of collision and traffic in the data transmission
channel.
A Bridge has filtering capacity. It means that it can discard the faulty data frames and will allow only the
errorless data frames in the network. Also, it can check the destination MAC address of a frame and
decides the port from which the frame should be sent out. For this, it maintains a table containing the
physical(MAC) addresses of all the devices in the network. Whenever a data frame arrives at the
incoming port of the bridge, it first checks the data frame for any kind of errors. If the frame is errorless,
it directs the data frame to the specified MAC address(taking instance from the address table) using its
outgoing port. It does not change the physical(MAC Address) of the frames during transmission. In
other words, a Bridge is a Repeater with filtering capability.
3. Switch
A switch is a layer-2 network connecting device, i.e., it works on the physical and data-link layer of the
OSI model. It interprets data in the form of data frames. A switch acts as a multiport bridge in the
network. It provides the bridging functionality with greater efficiency.
Page 26
COMPUTER NETWORKS
A switch maintains a Switch table which has the MAC addresses of all the devices connected to it. It is
preferred more over the hub, as it reduces any kind of unnecessary traffic in the transmission channel. A
switch can connect the devices only in the same network. It uses the full-duplex mode of communication
and saves bandwidth. The switch table keeps on updating every few seconds for better processing.
A Switch is an intelligent device with filtering capabilities. It can discard the faulty data frames and will
allow only the errorless data frames in the network. Also, it will forward the data frames to the specific
node based on the MAC address(taken from the Switch table). A Switch has multiple collision domains,
so it has least or no collisions in the transmission channel. In fact, every port of switch has a separate
collision domain.
When a data frame arrives at the Switch, it first checks for any kind of error in the data frame. If the
frame is error-free, it will search the MAC address of the destination in the Switch table. If the address is
available in the switch table, it will forward the data frame to that specific node, else switch will register
the MAC address in the switch table. If the destination address is not specified, it will broadcast the data
frame to each node in the network.
A Switch can have 8/6/24/48 ports. The data transmission speed is slow in a switch(around 10-100
Mbps). Also, it has only one broadcasting domain.
Page 27
COMPUTER NETWORKS
4. Router
A Router is a layer-3 network connecting device, i.e., it works on the physical, data-link and network
layer of the OSI model. It interprets data in the form of data packets. It is mainly an internetworking
device, which can connect devices of different networks(implementing the same architecture and
protocols). In other words, it can connect two physically and logically different network devices with
each other. A Router is used to connect the networks or it routes traffic between the networks. In other
words, a Router is the Gateway of a network.
Since, connecting two devices of different networks, the connecting device should implement an
Internet Protocol (IP) address. So, the Router has a physical and logical (Internet Protocol) address for
each of its interfaces. It routes or forwards the data packets from one network to another based on their
IP addresses. It changes the physical address of the data packet(both source and destination) when it
forwards the data packets.
A router maintains a routing table using the routing algorithms. When a data packet is received at the
router, it first checks the IP address. If the IP address is the same as the network's IP address, it receives
the data packet, else it forwards the data packet to the destination IP address using the routing table.
A router does not perform addressing. It can have 2/4/8 ports for connecting the devices. It can control
both the collision domain(inside the network) and the broadcast domain(outside the network). It has a
fast data transmission speed(up to 1 Gbps). A Router can be a Wireless Router, Core Routers, Edge
Routers, Virtual Routers, etc.
There are mainly two types of routing performed by Routers, they are:
Static Routing: In Static Routing, the path for the data packets is manually set. It is generally used for
small networks.
Dynamic Routing: In Dynamic Routing, various routing algorithms are used to find the best and shortest
path for the data packets.
Page 28
COMPUTER NETWORKS
Page 29
COMPUTER NETWORKS
ALOHA is a system for coordinating and arbitrating access to a shared communication Networks
channel. It was developed in the 1970s by Norman Abramson and his colleagues at the University of
Hawaii. The original system used for ground based radio broadcasting, but the system has been
implemented in satellite communication systems.
A shared communication system like ALOHA requires a method of handling collisions that occur when
two or more systems attempt to transmit on the channel at the same time. In the ALOHA system, a node
transmits whenever data is available to send. If another node transmits at the same time, a collision
occurs, and the frames that were transmitted are lost. However, a node can listen to broadcasts on the
medium, even its own, and determine whether the frames were transmitted.
Aloha means “Hello”. Aloha is a multiple access protocol at the data-link layer and proposes how
multiple terminals access the medium without interference or collision. In 1972 Roberts developed a
protocol that would increase the capacity of aloha two fold. The Slotted Aloha protocol involves
dividing the time interval into discrete slots and each slot interval corresponds to the time period of one
frame. This method requires synchronization between the sending nodes to prevent collisions.
Pure ALOHA
In pure ALOHA, the stations transmit frames whenever they have data to send. When two or
more stations transmit simultaneously, there is collision and the frames are destroyed.
In pure ALOHA, whenever any station transmits a frame, it expects the acknowledgement from
the receiver.
If acknowledgement is not received within specified time, the station assumes that the frame (or
acknowledgement) has been destroyed.
If the frame is destroyed because of collision the station waits for a random amount of time and
sends it again. This waiting time must be random otherwise same frames will collide again and
again.
Page 30
COMPUTER NETWORKS
Therefore pure ALOHA dictates that when time-out period passes, each station must wait for a
random amount of time before re-sending its frame. This randomness will help avoid more
collisions.
In fig there are four stations that .contended with one another for access to shared channel. All these
stations are transmitting frames. Some of these frames collide because multiple frames are in contention
for the shared channel. Only two frames, frame 1.1 and frame 2.2 survive. All other frames are
destroyed.
Whenever two frames try to occupy the channel at the same time, there will be a collision and both will
be damaged. If first bit of a new frame overlaps with just the last bit of a frame almost finished, both
frames will be totally destroyed and both will have to be retransmitted.
Slotted ALOHA
Slotted ALOHA was invented to improve the efficiency of pure ALOHA as chances of collision
in pure ALOHA are very high.
In slotted ALOHA, the time of the shared channel is divided into discrete intervals called slots.
The stations can send a frame only at the beginning of the slot and only one frame is sent in each
slot.
In slotted ALOHA, if any station is not able to place the frame onto the channel at the beginning
of the slot i.e. it misses the time slot then the station has to wait until the beginning of the next
time slot.
Page 31
COMPUTER NETWORKS
In slotted ALOHA, there is still a possibility of collision if two stations try to send at the
beginning of the same time slot as shown in fig.
Slotted ALOHA still has an edge over pure ALOHA as chances of collision are reduced to one-
half.
Carrier Sensed Multiple Access (CSMA): CSMA is a network access method used on shared network
topologies such as Ethernet to control access to the network. Devices attached to the network cable
listen (carrier sense) before transmitting. If the channel is in use, devices wait before transmitting. MA
(Multiple Access) indicates that many devices can connect to and share the same network. All devices
have equal access to use the network when it is clear.
In other words, a station that wants to communicate “listen” first on the media communication and
awaits a “silence” of a preset time (called the Distributed Inter Frame Space or DIFS). After this
compulsory period, the station starts a countdown for a random period considered. The maximum
duration of this countdown is called the collision window (Window Collision, CW). If no equipment
speaks before the end of the countdown, the station simply delivers its package. However, if it is
overtaken by another station, it stops immediately its countdown and waits for the next silence. She then
continued his account countdown where it left off. This is summarized in Figure. The waiting time
random has the advantage of allowing a statistically equitable distribution of speaking time between the
various network equipment, while making little unlikely (but not impossible) that both devices speak
exactly the same time. The countdown system prevents a station waiting too long before issuing its
package. It‟s a bit what place in a meeting room when no master session (and all the World‟s polite)
Page 32
COMPUTER NETWORKS
expected a silence, then a few moments before speaking, to allow time for someone else to speak. The
time is and randomly assigned, that is to say, more or less equally.
Again, this is what we do naturally in a meeting room if many people speak exactly the same time, they
are realizing account immediately (as they listen at the same time they speak), and they interrupt without
completing their sentence. After a while, one of them speaks again. If a new collision occurs, the two are
interrupted again and tend to wait a little longer before speaking again.
CSMA protocol was developed to overcome the problem found in ALOHA i.e. to minimize the chances
of collision, so as to improve the performance. CSMA protocol is based on the principle of „carrier
sense‟. The station senses the carrier or channel before transmitting a frame. It means the station checks
the state of channel, whether it is idle or busy.
Even though devices attempt to sense whether the network is in use, there is a good chance that two
stations will attempt to access it at the same time. On large networks, the transmission time between one
end of the cable and another is enough that one station may access the cable even though another has
already just accessed it.
The chances of collision still exist because of propagation delay. The frame transmitted by one station
takes some time to reach other stations. In the meantime, other stations may sense the channel to be idle
and transmit their frames. This results in the collision.
Page 33
COMPUTER NETWORKS
I-persistent CSMA
In this method, station that wants to transmit data continuously senses the channel to check
whether the channel is idle or busy.
If the channel is busy, the station waits until it becomes idle.
When the station detects an idle-channel, it immediately transmits the frame with probability 1.
Hence it is called I-persistent CSMA.
This method has the highest chance of collision because two or more stations may find channel
to be idle at the same time and transmit their frames.
When the collision occurs, the stations wait a random amount of time and start allover again.
Drawback of I-persistent
The propagation delay time greatly affects this protocol. Let us suppose, just after the station I begins its
transmission, station 2 also became ready to send its data and senses the channel. If the station I signal
has not yet reached station 2, station 2 will sense the channel to be idle and will begin its transmission.
This will result in collision.1 Persistent CSMA
Even if propagation delay time is zero, collision will still occur. If two stations became .ready in the
middle of third station‟s transmission, both stations will wait until the transmission of first station ends
and then both will begin their transmission exactly simultaneously. This will also result in collision.
In this scheme, if a station wants to transmit a frame and it finds that the channel is busy (some
other station is transmitting) then it will wait for fixed interval oftime.
After this time, it again checks the status of the channel and if the channel is.free it will transmit.
A station that has a frame to send senses the channel.
If the channel is idle, it sends immediately.
If the channel is busy, it waits a random amount of time and then senses the channel again.
In non-persistent CSMA the station does not continuously sense the channel for the purpose of
capturing it when it detects the end of previous transmission.
Page 34
COMPUTER NETWORKS
Advantage of non-persistent
It reduces the chance of collision because the stations wait a random amount of time. It is
unlikely that two or more stations will wait for same amount of time and will retransmit at the
same time.
Disadvantage of non-persistent
It reduces the efficiency of network because the channel remains idle when there may be stations
with frames to send. This is due to the fact that the stations wait a random amount of time after
the collision.
This method is used when channel has time slots such that the time slot duration is equal to or
greater than the maximum propagation delay time.
Whenever a station becomes ready to send, it senses the channel.
If channel is busy, station waits until next slot.
If channel is idle, it transmits with a probability p.
With the probability q=l-p, the station then waits for the beginning of the next time slot.
If the next slot is also idle, it either transmits or waits again with probabilities p and q.
This process is repeated till either frame has been transmitted or another station has begun
transmitting.
In case of the transmission by another station, the station acts as though a collision has occurred
and it waits a random amount of time and starts again.
Page 35
COMPUTER NETWORKS
Advantage of p-persistent
It reduces the chance of collision and improves the efficiency of the network.
Again, this is what we do naturally in a meeting room if many people speak exactly the same time, they
are realizing account immediately (as they listen at the same time they speak), and they interrupt without
completing their sentence. After a while, one of them speaks again. If a new collision occurs, the two are
interrupted again and tend to wait a little longer before speaking again.
Page 36
COMPUTER NETWORKS
1. Preamble: It is seven bytes (56 bits) that provides bit synchronization. It consists of
alternating Os and 1s. The purpose is to provide alert and timing pulse.
Page 37
COMPUTER NETWORKS
2. Start Frame Delimiter (SFD): It is one byte field with unique pattern: 10 10 1011. It
marks the beginning of frame.
3. Destination Address (DA): It is six byte field that contains physical address of packet‟s
destination.
4. Source Address (SA): It is also a six byte field and contains the physical address of
source or last device to forward the packet (most recent router to receiver).
5. Length: This two byte field specifies the length or number of bytes in data field.
6. Data: It can be of 46 to 1500 bytes, depending upon the type of frame and the length of
the information field.
7. Frame Check Sequence (FCS): This for byte field contains CRC for error detection.
Contention Window:
Contention window is an amount of time divided into slots.
A station that is ready to send chooses a random number of slots as its wait time.
The number of slots in the window changes according to the binary exponential back-off
strategy. It means that it is set of one slot the first time and then doubles each time the station
cannot detect an idle channel after the IFS time.
Page 38
COMPUTER NETWORKS
This is very similar to the p-persistent method except that a random outcome defines the number
of slots taken by the waiting station.
In contention window the station needs to sense the channel after each time slot.
If the station finds the channel busy, it does not restart the process. It just stops the timer &
restarts it when the channel is sensed as idle.
Acknowledgement
Despite all the precautions, collisions may occur and destroy the data.
The positive acknowledgment and the time-out timer can help guarantee that receiver has
received the frame.
1. Reservation:
In the reservation method, a station needs to make a reservation before sending data. Time is divided
into intervals. In each interval, a reservation frame precedes the data frames sent in that interval.
If there are N stations in the system, there are exactly N reservation minislots in the reservation frame.
Each minislot belongs to a station. When a station needs to send a data frame, it makes a reservation in
its own minislot. The stations that have made reservations can send their data frames after the
reservation frame.
The following figure shows a situation with five stations and a five-minislot reservation frame. In the
first interval, only stations 1, 3, and 4 have made reservations. In the second interval, only station 1 has
made a reservation.
Page 39
COMPUTER NETWORKS
2. Polling:
Polling works with topologies in which one device is designated as a primary station and the other
devices are secondary stations. All data exchanges must be made through the primary device even when
the ultimate destination is a secondary device.
The primary device controls the link; the secondary devices follow its instructions. It is up to the
primary device to determine which device is allowed to use the channel at a given time. The primary
device, therefore, is always the initiator of a session. Consider the following figure.
If the primary wants to receive data, it asks the secondaries if they have anything to send, this is called
poll function. If the primary wants to send data, it tells the secondary to get ready to receive; this is
called select function.
Select:
The select function is used whenever the primary device has something to send. If it has something to
send, the primary device sends it. It has to know whether the target device is prepared to receive or not.
So the primary must alert the secondary to the upcoming transmission and wait for an acknowledgment
of the secondary's ready status. Before sending data, the primary creates and transmits a select (SEL)
frame, one field of which includes the address of the intended secondary.
Poll:
The poll function is used by the primary device to solicit transmissions from the secondary devices.
When the primary is ready to receive data, it must ask (poll) each device in turn if it has anything to
send. When the first secondary is approached, it responds either with a NAK frame if it has nothing to
send or with data (in the form of a data frame) if it does. If the response is negative (a NAK frame), then
the primary polls the next secondary in the same manner until it finds one with data to send. When the
response is positive (a data frame), the primary reads the frame and returns an acknowledgment (ACK
frame), verifying its receipt.
Page 40
COMPUTER NETWORKS
3. Token Passing:
In the token-passing method, the stations in a network are organized in a logical ring. In other words, for
each station, there is a predecessor and a successor. The predecessor is the station which is logically
before the station in the ring; the successor is the station which is after the station in the ring. The
current station is the one that is accessing the channel now. The right to this access has been passed from
the predecessor to the current station. The right will be passed to the successor when the current station
has no more data to send.
In this method, a special packet called a token circulates through the ring. The possession of the token
gives the station the right to access the channel and send its data. When a station has some data to send,
it waits until it receives the token from its predecessor. It then holds the token and sends its data. When
the station has no more data to send, it releases the token, passing it to the next logical station in the ring.
The station cannot send data until it receives the token again in the next round.
Token management is needed for this access method. Stations must be limited in the time they can have
possession of the token. The token must be monitored to ensure it has not been lost or destroyed. For
example, if a station that is holding the token fails, the token will disappear from the network. Another
function of token management is to assign priorities to the stations and to the types of data being
transmitted. And finally, token management is needed to make low- priority stations release the token to
high priority stations.
Logical Ring:
In a token-passing network, stations do not have to be physically connected in a ring; the ring can be a
logical one. The following figure show four different physical topologies that can create a logical ring.
In the physical ring topology, when a station sends the token to its successor, the token cannot be seen
by other stations; the successor is the next one in line. This means that the token does not have to have
the address of the next successor. The problem with this topology is that if one of the links-the medium
between two adjacent stations fails, the whole system fails.
The dual ring topology uses a second (auxiliary) ring which operates in the reverse direction compared
with the main ring. The second ring is for emergencies only. If one of the links in the main ring fails, the
system automatically combines the two rings to form a temporary ring. After the failed link is restored,
the auxiliary ring becomes idle again.
In the bus ring topology, also called a token bus, the stations are connected to a single cable called a bus.
They, however, make a logical ring, because each station knows the address of its successor (and also
predecessor for token management purposes). When a station has finished sending its data, it releases
the token and inserts the address of its successor in the token. Only the station with the address matching
Page 41
COMPUTER NETWORKS
the destination address of the token gets the token to access the shared media. The Token Bus LAN,
standardized by IEEE, uses this topology.
In a star ring topology, the physical topology is a star. There is a hub, however, that acts as the
connector. The wiring inside the hub makes the ring; the stations are connected to this ring through the
two wire connections. This topology makes the network less prone to failure because if a link goes
down, it will be bypassed by the hub and the rest of the stations can operate. Also adding and removing
stations from the ring is easier. This topology is still used in the Token Ring LAN designed by IBM.
Channelization
Channelization is a multiple-access method in which the available bandwidth of a link is shared in time,
frequency, or through code, between different stations. The three channelization protocols are FDMA,
TDMA, and CDMA.
In frequency-division multiple access (FDMA), the available bandwidth is divided into frequency bands.
Each station is allocated a band to send its data. In other words, each band is reserved for a specific
station, and it belongs to the station all the time. Each station also uses a bandpass filter to confine the
transmitter frequencies. To prevent station interferences, the allocated bands are separated from one
another by small guard bands.
FDMA specifies a predetermined frequency band for the entire period of communication. This means
that stream data (a continuous flow of data that may not be packetized) can easily be used with FDMA.
We will see in Chapter 16 how this feature can be used in cellular telephone systems.
We need to emphasize that although FDMA and FDM conceptually seem similar, there are differences
between them. FDM, as we saw in Chapter 6, is a physical layer technique that combines the loads from
low-bandwidth channels and transmits them by using a high-bandwidth channel. The channels that are
combined are low-pass. The multiplexer modulates the signals, combines them, and creates a bandpass
signal. The bandwidth of each channel is shifted by the multiplexer.
FDMA, on the other hand, is an access method in the data link layer. The data link layer in each station
tells its physical layer to make a bandpass signal from the data passed to it. The signal must be created in
the allocated band. There is no physical multiplexer at the physical layer. The signals created at each
station are automatically bandpass-filtered. They are mixed when they are sent to the common channel.
Page 42
COMPUTER NETWORKS
In time-division multiple access (TDMA), the stations share the bandwidth of the channel in time. Each
station is allocated a time slot during which it can send data. Each station transmits its data in is assigned
time slot. Figure 12.22 shows the idea behind TDMA.
The main problem with TDMA lies in achieving synchronization between the different stations. Each
station needs to know the beginning of its slot and the location of its slot. This may be difficult because
of propagation delays introduced in the system if the stations are spread over a large area. To
compensate for the delays, we can insert guard times. Synchronization is normally accomplished by
having some synchronization bits (normally referred to as preamble bits) at the beginning of each slot.
In TDMA, the bandwidth is just one channel that is timeshared between different stations.
We also need to emphasize that although TDMA and TDM conceptually seem the same, there are
differences between them. TDM, is a physical layer technique that combines the data from slower
channels and transmits them by using a faster channel. The process uses a physical multiplexer that
interleaves data units from each channel. TDMA, on the other hand, is an access method in the data link
layer. The data link layer in each station tells its physical layer to use the allocated time slot. There is no
physical multiplexer at the physical layer.
Code-division multiple access (CDMA) was conceived several decades ago. Recent advances in
electronic technology have finally made its implementation possible. CDMA differs from FDMA
because only one channel occupies the entire bandwidth of the link. It differs from TDMA because all
stations can send data simultaneously; there is no timesharing.
A channel access method or multiple access method allows several terminals connected to the same
multi-point transmission medium to transmit over it and to share its capacity. Examples of shared
physical media are wireless networks, bus networks, ring networks and half-duplex point-to-point links.
A channel-access scheme is based on a multiplexing method, that allows several data streams or signals
to share the same communication channel or physical medium. Multiplexing is in this context provided
by the physical layer. Note that multiplexing also may be used in full-duplex point-to-point
communication between nodes in a switched network, which should not be considered as multiple
accesses
(Reference material)
A channel-access scheme is also based on a multiple access protocol and control mechanism, also
known as media access control (MAC). This protocol deals with issues such as addressing, assigning
multiplex channels to different users, and avoiding collisions. The MAC-layer is a sub-layer in Layer 2
(Data Link Layer) of the OSI model and a component of the Link Layer of the TCP/IP model.
Page 43
COMPUTER NETWORKS
The frequency-division multiple access (FDMA) channel-access scheme is based on the frequency-
division multiplexing (FDM) scheme, which provides different frequency bands to different data-
streams. In the FDMA case, the data streams are allocated to different nodes or devices. An example of
FDMA systems were the first-generation (1G) cell-phone systems, where each phone call was assigned
to a specific uplink frequency channel, and another downlink frequency channel. Each message signal
(each phone call) is modulated on a specific carrier frequency.
An advanced form of FDMA is the orthogonal frequency-division multiple access (OFDMA) scheme, for
example used in 4G cellular communication systems. In OFDMA, each node may use several sub-
carriers, making it possible to provide different quality of service (different data rates) to different users.
The assignment of sub-carriers to users may be changed dynamically, based on the current radio
channel conditions and traffic load. Time division multiple access (TDMA)
The time division multiple access (TDMA) channel access scheme is based on the time-division
multiplexing (TDM) scheme, which provides different time-slots to different data-streams (in the TDMA
case to different transmitters) in a cyclically repetitive frame structure. For example, node 1 may use
time slot 1, node 2 time slot 2, etc. until the last transmitter. Then it starts all over again, in a repetitive
pattern, until a connection is ended and that slot becomes free or assigned to another node. An
advanced form is Dynamic TDMA (DTDMA), where a scheduling may give different time sometimes but
some times node 1 may use time slot 1 in first frame and use another time slot in next frame.
As an example, 2G cellular systems are based on a combination of TDMA and FDMA. Each frequency
channel is divided into eight timeslots, of which seven are used for seven phone calls, and one for
signaling data. Code division multiple access (CDMA)/Spread spectrum multiple access (SSMA) The
code division multiple access (CDMA) scheme is based on spread spectrum, meaning that a wider radio
spectrum in Hertz is used than the data rate of each of the transferred bit streams, and several message
signals are transferred simultaneously over the same carrier frequency, utilizing different spreading
codes. The wide bandwidth makes it possible to send with a very poor signal-to-noise ratio of much less
than 1 (less than 0 dB) according to the Shannon-Heartly formula, meaning that the transmission power
can be reduced to a level below the level of the noise and co-channel interference (cross talk) from other
message signals sharing the same frequency. One form is direct sequence spread spectrum (DS-CDMA),
Page 44
COMPUTER NETWORKS
used for example in 3G cell phone systems. Each information bit (or each symbol) is represented by a
long code sequence of several pulses, called chips. The sequence is the spreading code, and each
message signal (for example each phone call) use different spreading code.
Another form is frequency-hopping (FH-CDMA), where the channel frequency is changing very rapidly
according to a sequence that constitutes the spreading code. As an example, the Bluetooth
communication system is based on a combination of frequency-hopping and either CSMA/CA packet
mode communication (for data communication applications) or TDMA (for audio transmission). All
nodes belonging to the same user (to the same virtual private area network or picante) use the same
frequency hopping sequences synchronously, meaning that they send on the same frequency channel, but
CDMA/CA or TDMA is used to avoid collisions within the VPAN. Frequency-hopping is used to reduce
the cross-talk and collision probability between nodes in different VPAN’s.
Page 45