Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
12 views

Compter Network Practical File

This book help students to learn about computer network

Uploaded by

surajprakash0852
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Compter Network Practical File

This book help students to learn about computer network

Uploaded by

surajprakash0852
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 25

Practical File of

Computer Networks (UGCA- 1916)

Submitted To
Submitted by:
Assist Prof: Ms.Harpreet Kaur

University Roll No:


Class: B.C.A -3sem

1|Page
Sr.no. Content Pages Remarks.

1. Familiarization with networking


components and devices: LAN
adapters, hubs ,switches, routers etc.

2. Familiarization with transmission


media and tools: Coaxial cable
3. Study of various LAN topologies
and their creation using network
devices, cables and computers.

4. Configurations of TCP/IP protocols.

5. Implementation of resource sharing


(file, printer etc.)
6. To compute the hamming distance
between any two code words.
7. Explain OSI model.
8. Application Layer-distributed
application (client/server, peer to
peer, cloud etc.).

9. IEEE standards (IEEE802.3,


Ethernet, Gigabit Ethernet, IEEE
802.4 Token Bus, IEEE 802.5 Token
Ring)

10. Leaky bucket algorithm.

Index:

2|Page
Index:

1. Familiarization with Networking components and devices:


LAN Adapters, Hubs, Switches, routers etc.

LAN ADAPTERS: - A LAN adapter is a device used to allow a computer to


interface with a network. Many computers may have some sort LAN adapter already
installed, but others may require a special installation, which is accomplished by adding a
network interface card to the system or possibly connecting the adapter to a USB port.
Networks this type of network is one used over a limited geographic area. Most of the
time, the network goes no further than the building which houses its main components,
though that is not always the case.

Types of LAN ADAPTER:


Wireless LAN adapter: - wireless LAN provides instant connectively to mobile
personnel.it also avoids the costly expense of running Ethernet cable throughout a
building, providing, easy, effortless desktop between clients.

On this network segment, all computers can communicate directly with each other. A hub
includes a series of pots that each accepts a network cable.

USB LAN adapter: the USB router adapter simply connects to the computer through a
USB port, and then will find wireless networks in the area and allow the user to connect
to one.

3|Page
Virtual LAN adapter: such adapters may functions as an external network adapter and
thus remain outside the primary electronic device or they may be installed into the
device’s main physical body.
Wireless LAN USB adapter: A keyboard, mouse, or headset can be connected to your
computer using a dongle that plugs into a USB port on the computer but doesn’t need to
connect to anything
HUB: a special type of network device called the hub can be found in many home and
small business networks. Hub is small rectangular box, often made of plastic the receives
its power from an or]dinary wall outlet.

Role of switch: switches may operate at one or more layers of the OSI model, including
data link and network.
Routers: a router is a device that forwards data packets between computer networks,
creating an overlay internetwork. A router is connected to two or more data lines from
different networks.

2. Familiarization with transmission media and tools: Coaxial


cable:
Transmission media: the medium through which communication takes place b/w the
PCs. At the lowest level, all computer communication involves encoding data in the form
of energy and sending the energy across a transmission medium. Hardware devices
attached to the computer perform encoding and decoding of data.

Coaxial cable: the copper wiring used in now is coaxial cable the same type of wiring used
for cable TV. It is provide even more protection from interferences than twisted pair. Instead of
twisting the wires around one another to limit interferences, a coaxial cable consists of a single
wire surround by a heavier metal shield.
Coaxial cable assemblies are easy to install and very durable. Because the coaxial cable has the
best performance in a short distance, it is very suitable for and average capacity data
transmission network. When using coaxial cables over long distances, signal loss is a
disadvantage. And the signal leakage is easy to occur at the entrance or exit position, that is, the
contact point between the male connector and the female connector. Leakage can cause

4|Page
distortion and blur the signal. During high usage rates, speed fluctuations in broadband networks
also occur during data transmission.

Advantages of Coaxial Cable


 Coaxial cable is very durable
 Best performance in short-distance transmission

Disadvantages of Coaxial Cable


 Long-distance signal loss is serious
 Signal leakage at the connection
 Speed fluctuation under heavy use

3. Study of various LAN topologies and their creation using


network devices, cables and computers:
LAN TOPOLOGY: the way how the pieces are connected with each other is called
is called physical or network topology.
Bus topology: it comprises of stations that are connected to a single communication
line. This single communication line referred to as bus. If destination field does not match
the station address, the station discards the information frame back on to the bus.

Features of Bus Topology


1. It transmits data only in one direction.
2. Every device is connected to a single cable
Advantages of Bus Topology
1. It is cost effective.
2. Cable required is least compared to other network topology.
3. Used in small networks.

5|Page
4. It is easy to understand.
5. Easy to expand joining two cables together.
Disadvantages of Bus Topology
1. Cables fails then whole network fails.
2. If network traffic is heavy or nodes are more the performance of the network decreases.
3. Cable has a limited length.
4. It is slower than the ring topology.

Ring topology: LAN that have each station attached to an adjacent station using point
to point links from physical ring. Each station attached and active to the ring regenerates
the information frame, then the retransmit information frame on the ring.

Star topology: it comprises no. of stations connected directly to central station


communications on the connecting links b/w the stations and the central station of star
topography can be bidirectional and are point to point. The central controller manages
and controls all communications b/w stations on the n/w.
Features of Ring Topology
1. A number of repeaters are used for Ring topology with large number of nodes, because if
someone wants to send some data to the last node in the ring topology with 100 nodes,
then the data will have to pass through 99 nodes to reach the 100th node. Hence to
prevent data loss repeaters are used in the network.
2. The transmission is unidirectional, but it can be made bidirectional by having 2
connections between each Network Node, it is called Dual Ring Topology.
3. In Dual Ring Topology, two ring networks are formed, and data flow is in opposite
direction in them. Also, if one ring fails, the second ring can act as a backup, to keep the
network up.
4. Data is transferred in a sequential manner that is bit by bit. Data transmitted, has to pass
through each node of the network, till the destination node.
Advantages of Ring Topology
1. Transmitting network is not affected by high traffic or by adding more nodes, as only the
nodes having tokens can transmit data.
2. Cheap to install and expand
Disadvantages of Ring Topology
1. Troubleshooting is difficult in ring topology.
2. Adding or deleting the computers disturbs the network activity.
3. Failure of one computer disturbs the whole network.

6|Page
Tree topology: the corollary to the topology is tree topology. It extends the branches
of the bus topology allowing more stations to access the bus. On bus or tree now, there is
no central management and control functions are distributed to each station of the bus.
Features of Star Topology
1. Every node has its own dedicated connection to the hub.
2. Hub acts as a repeater for data flow.
3. Can be used with twisted pair, Optical Fibre or coaxial cable.
Advantages of Star Topology
1. Fast performance with few nodes and low network traffic.
2. Hub can be upgraded easily.
3. Easy to troubleshoot.
4. Easy to setup and modify.
5. Only that node is affected which has failed, rest of the nodes can work smoothly.
Disadvantages of Star Topology
1. Cost of installation is high.
2. Expensive to use.
3. If the hub fails then the whole network is stopped because all the nodes depend on the hub.
4. Performance is based on the hub that is it depends on its capacity

MESH Topology
It is a point-to-point connection to other nodes or devices. All the network nodes are
connected to each other. Mesh has n(n-1)/2 physical channels to link n devices.
There are two techniques to transmit data over the Mesh topology, they are :
1. Routing
2. Flooding
MESH Topology: Routing
In routing, the nodes have a routing logic, as per the network requirements. Like routing
logic to direct the data to reach the destination using the shortest distance. Or, routing
logic which has information about the broken links, and it avoids those node etc. We can
even have routing logic, to re-configure the failed nodes.
MESH Topology: Flooding

7|Page
In flooding, the same data is transmitted to all the network nodes, hence no routing logic
is required. The network is robust, and the its very unlikely to lose the data. But it leads
to unwanted load over the network.

Types of Mesh Topology


1. Partial Mesh Topology: In this topology some of the systems are connected in
the same fashion as mesh topology but some devices are only connected to two or three
devices.
2. Full Mesh Topology: Each and every nodes or devices are connected to each
other.
Features of Mesh Topology
1. Fully connected.
2. Robust.
3. Not flexible.
Advantages of Mesh Topology
1. Each connection can carry its own data load.
2. It is robust.
3. Fault is diagnosed easily.
4. Provides security and privacy.
Disadvantages of Mesh Topology
1. Installation and configuration is difficult.
2. Cabling cost is more.
3. Bulk wiring is required.

TREE Topology
It has a root node and all other nodes are connected to it forming a hierarchy. It is also
called hierarchical topology. It should at least have three levels to the hierarchy.

8|Page
Features of Tree Topology
1. Ideal if workstations are located in groups.
2. Used in Wide Area Network.
Advantages of Tree Topology
1. Extension of bus and star topologies.
2. Expansion of nodes is possible and easy.
3. Easily managed and maintained.
4. Error detection is easily done.
Disadvantages of Tree Topology
1. Heavily cabled.
2. Costly.
3. If more nodes are added maintenance is difficult.
4. Central hub fails, network fails.

HYBRID Topology
It is two different types of topologies which is a mixture of two or more topologies. For
example if in an office in one department ring topology is used and in another star
topology is used, connecting these topologies will result in Hybrid Topology (ring
topology and star topology).

Features of Hybrid Topology


1. It is a combination of two or topologies
2. Inherits the advantages and disadvantages of the topologies included
Advantages of Hybrid Topology
1. Reliable as Error detecting and trouble shooting is easy.
2. Effective.
3. Scalable as size can be increased easily.
4. Flexible.
Disadvantages of Hybrid Topology
1. Complex in design.
2. Costly.

9|Page
4. Configurations of TCP/IP protocols.

The following instructions are based on the configuring TCP/IP function of windows XP
1. Click start>settings>control panel.
2. On the control panel, double click Network and dial up connections.
3. Right click Local Area Connection.
4. Click properties. If Internet Protocol (TCP/IP) does not appear in the list, do the
following:
a. Click install.
b. Select protocol and then click add.
c. Select Internet Protocol (TCP/IP).
d. Click ok. This returns you to the Local area connection properties window:
5. Select Internet Protocol(TCP/IP), and then click on Properties.
6. Select using the following IP address. Check with your network administrator to
determine the correct settings for the tab. If your PC not automatically obtain IP and
DNS addresses do the following:
a. Enter the IP address of your PC (for example, 199.5.83.205).
b. Enter the subnet mask (for example, 199.5.83.1).
c. Enter the default gateway (for example, 199.5100.75).
d. Enter the preferred DNS server (for example, 199.5.100.76).
e. Enter the alternate DNS server (for example, 199.5.100.76).
7. If you using a window internet name server, click the advanced tab, select wins
address, and do the following:

10 | P a g e
a. Click add.
b. Enter the primary wins server (for example, 199.5.83.205).
c. Enter the secondary wins server (for example, 199.5.83.206).
d. The remaining settings should remain as the defaults.
8. Click ok on the Local area connections properties window. It is not necessary to
restart your PC.
5. Implementation of file and printer sharing:
Sharing a printer:
1. Open the windows control panel.
2. Double click network.
3. In the network window under the configuration tab click the file and printing sharing
button.
4. In the file and print sharing window check the “1 want to be able to allow others to
print to my printer(s)” option. Note: if the computer asks to restart the computer after
selecting this option make sure to restart.
5. Click ok and the ok again to close out of the network window.
6. Once back in the control panel double click printers.
7. If you currently have a printer already installed on the computer right click the printer
icon and click properties window click the sharing tab and make sure the printer is
shared.

Share a file:
1. Open the my computer
2. Select the drive (C,D,E,F)
3. Right click the selected drive 4...click the property button. From that menu choose the
sharing option.
4. Click the share this folder.
5. Click the new share, enter share name and click ok.

6. To compute the hamming distance between any two code words.


Hamming distance:

11 | P a g e
Hamming distance is a metric for comparing two binary data strings. While comparing
two binary strings of equal length, hamming distance is the number of bit positions in
which the two bits are different.
The hamming distance between two strings a and b is denoted as d (a, b)
It used for error detection or error correction when data is transmitted over computer
networks.it is also using in coding theory for comparing equal length data words.

Hamming distance between two codes:


Given two integers, the task is to find the hamming distance between two integers.
Hamming distance between two integers is the number of bits which are different at same
position in both numbers.
Examples:
Input: n1=9, n2=14
Output: 3
9=1001, 14=1100
No. of different bits=3

Input: n1=4, n2=8


Output:2

7. Explain OSI MODEL:


OSI MODEL: the open systems interconnection (OSI) model is a conceptual model
created by the international organization communication systems to communicate using
standard protocols. In plain English, the OSI provides a standard for different computer
systems to be able to communicate with each other

12 | P a g e
1 .Application layer: This is the only layer that directly interacts with data from the
user. Software applications like web browsers and email clients rely on the application
layer to initiate communications. Applications layer protocols include HTTP as well as
SMTP (simple mail transfer protocol is one of the protocols that enables
communications).

Functions of Application Layer:


1. Mail Services: This layer provides the basis for E-mail forwarding and storage.
2. Network Virtual Terminal: It allows a user to log on to a remote host. The application
creates software emulation of a terminal at the remote host. User's computer talks to the
software terminal which in turn talks to the host and vice versa. Then the remote host
believes it is communicating with one of its own terminals and allows user to log on.
3. Directory Services: This layer provides access for global information about various
services.
4. File Transfer, Access and Management (FTAM): It is a standard mechanism to access
files and manages it. Users can access files in a remote computer and manage it. They can
also retrieve files from a remote computer

13 | P a g e
2. The Presentation layer: this layer is primarily responsible for preparing data so
that it can be used by the application layer; in other words, layer 6 makes the data
presentable for applications to consume. The presentation layer is responsible for
translation, encryption and compression of the data.

Functions of Presentation Layer:


1. Translation: Before being transmitted, information in the form of characters and
numbers should be changed to bit streams. The presentation layer is responsible for
interoperability between encoding methods as different computers use different encoding
methods. It translates data between the formats the network requires and the format the
computer.
2. Encryption: It carries out encryption at the transmitter and decryption at the receiver.
3. Compression: It carries out data compression to reduce the bandwidth of the data to be
transmitted. The primary role of Data compression is to reduce the number of bits to be
0transmitted. It is important in transmitting multimedia such as audio, video, text etc.
3 The Session layer: This is the layer responsible for opening and closing
communication between the two devices. The time between when the communication is
opened and closed is known as the session.

14 | P a g e
Functions of Session Layer
1. Dialog Control : This layer allows two systems to start communication with each other
in half-duplex or full-duplex.
2. Token Management: This layer prevents two parties from attempting the same critical
operation at the same time.
3. Synchronization : This layer allows a process to add checkpoints which are considered
as synchronization points into stream of data. Example: If a system is sending a file of
800 pages, adding checkpoints after every 50 pages is recommended. This ensures that 50
page unit is successfully received and acknowledged. This is beneficial at the time of
crash as if a crash happens at page number 110; there is no need to retransmit 1 to100
pages.
4 .The Transport layer: Layer 4 is responsible for end to end communication
between the two devices. This includes taking data from the session layer and breaking it
up into chunks called segments before sending it to layer 3.

Functions of Transport Layer


1. Service Point Addressing: Transport Layer header includes service point address which
is port address. This layer gets the message to the correct process on the computer unlike
Network Layer, which gets each packet to the correct computer.
2. Segmentation and Reassembling: A message is divided into segments; each segment
contains sequence number, which enables this layer in reassembling the message.
Message is reassembled correctly upon arrival at the destination and replaces packets
which were lost in transmission.
3. Connection Control: It includes 2 types:
o Connectionless Transport Layer : Each segment is considered as an independent
packet and delivered to the transport layer at the destination machine.
o Connection Oriented Transport Layer : Before delivering packets, connection is
made with transport layer at the destination machine.
4. Flow Control: In this layer, flow control is performed end to end.
5. Error Control: Error Control is performed end to end in this layer to ensure that the
complete message arrives at the receiving transport layer without any error. Error
Correction is done through retransmission.

15 | P a g e
5. The Networking layer:The networking layer is responsible for facilitating data transfer
between two different networks. If the two devices communication are on the same network, then
the network layer is unnecessary.

Functions of Network Layer


1. It translates logical network address into physical address. Concerned with circuit, message or
packet switching.
2. Routers and gateways operate in the network layer. Mechanism is provided by Network Layer for
routing the packets to final destination.
3. Connection services are provided including network layer flow control, network layer error
control and packet sequence control.
4. Breaks larger packets into small packets.

6. The Data link layer: The data link layer is very similar to the network layer,
except the data link layer facilities data transfer between two devices on the same
network.

Functions of Data Link Layer


1. Framing: Frames are the streams of bits received from the network layer into
manageable data units. This division of stream of bits is done by Data Link Layer.
2. Physical Addressing: The Data Link layer adds a header to the frame in order to define
physical address of the sender or receiver of the frame, if the frames are to be distributed
to different systems on the network.

16 | P a g e
3. Flow Control: A flow control mechanism to avoid a fast transmitter from running a slow
receiver by buffering the extra bit is provided by flow control. This prevents traffic jam at
the receiver side.
4. Error Control: Error control is achieved by adding a trailer at the end of the frame.
Duplication of frames are also prevented by using this mechanism. Data Link Layers
adds mechanism to prevent duplication of frames.
5. Access Control: Protocols of this layer determine which of the devices has control over
the link at any given time, when two or more devices are connected to the same link.
7. The physical layer: This layer includes the physical equipment involved in the
data transfer, such as the cables and switches. This is also the layer where the data gets
converted into a bit stream, which is a string of 1s and 0s.
Functions of Physical Layer:
Following are the various functions performed by the Physical layer of the OSI model.
1. Representation of Bits: Data in this layer consists of stream of bits. The bits must be
encoded into signals for transmission. It defines the type of encoding i.e. how 0's and 1's
are changed to signal.
2. Data Rate: This layer defines the rate of transmission which is the number of bits per
second.
3. Synchronization: It deals with the synchronization of the transmitter and receiver. The
sender and receiver are synchronized at bit level.
4. Interface: The physical layer defines the transmission interface between devices and
transmission medium.
5. Line Configuration: This layer connects devices with the medium: Point to Point
configuration and Multipoint configuration.
6. Topologies: Devices must be connected using the following topologies: Mesh, Star, Ring
and Bus.
7. Transmission Modes: Physical Layer defines the direction of transmission between two
devices: Simplex, Half Duplex, Full Duplex.
8. Deals with baseband and broadband transmission.

8. Application Layer-distributed application (client/server, peer to


peer, cloud etc.).
The application layer in the OSI model is the closest layer to the end user which means
that the application layer and end user can interact directly with the software application.
The application layer programs are based on client and servers.

17 | P a g e
Network Application Architecture

Application architecture is different from the network architecture. The network


architecture is fixed and provides a set of services to applications. The application
architecture, on the other hand, is designed by the application developer and defines how
the application should be structured over the various end systems.
Application architecture is of two types:

18 | P a g e
o Client-server architecture:

s
o An application program running on the local machine sends a request to another
application program is known as a client, and a program that serves a request is known as
a server. For example, when a web server receives a request from the client host, it
responds to the request to the client host.
Characteristics of Client-server architecture:
o In Client-server architecture, clients do not directly communicate with each other. For
example, in a web application, two browsers do not directly communicate with each
other.
o A server is fixed, well-known address known as IP address because the server is always
on while the client can always contact the server by sending a packet to the sender's IP
address.

Disadvantage of Client-server architecture:


It is a single-server based architecture which is incapable of holding all the requests from
the clients. For example, a social networking site can become overwhelmed when there is
only one server exists.

19 | P a g e
o P2P (peer-to-peer) architecture:

o It has no dedicated server in a data center. The peers are the computers which are not
owned by the service provider. Most of the peers reside in the homes, offices, schools,
and universities. The peers communicate with each other without passing the information
through a dedicated server, this architecture is known as peer-to-peer architecture. The
applications based on P2P architecture includes file sharing and internet telephony.

9. IEEE standards (IEEE802.3, Ethernet, Gigabit Ethernet, IEEE


802.4 Token Bus, IEEE 802.5 Token Ring):
IEEE 802.3 is a set of standards and protocols that define Ethernet-based networks.
Ethernet technologies are primarily used in LANs, though they can also be used in MANs
and even WANs. IEEE 802.3 defines the physical layer and the medium access control
(MAC) sub-layer of the data link layer for wired Ethernet networks.
Frame Format of IEEE 802.3
The main fields of a frame of classic Ethernet are -
 Preamble: It is a 7 bytes starting field that provides alert and timing pulse for
transmission.
 Start of Frame Delimiter: It is a 1 byte field that contains an alternating pattern of ones
and zeros ending with two ones.
 Destination Address: It is a 6 byte field containing physical address of destination
stations.
 Source Address: It is a 6 byte field containing the physical address of the sending
station.
 Length: It a 7 bytes field that stores the number of bytes in the data field.
 Data: This is a variable sized field carries the data from the upper layers. The maximum
size of data field is 1500 bytes.

20 | P a g e
 Padding: This is added to the data to bring its length to the minimum requirement of 46
bytes.
 CRC: CRC stands for cyclic redundancy check. It contains the error detection
information.

Ethernet is the traditional technology for connecting devices in a wired local area
network (LAN) or wide area network (WAN), enabling them to communicate with each
other via a protocol -- a set of rules or common network language. Ethernet describes
how network devices can format and transmit data so other devices on the same local or
campus area network segment can recognize, receive and process the information. An
Ethernet cable is the physical, encased wiring over which the data travels.
In computer networks, Gigabit Ethernet (GbE) is the family of Ethernet technologies
that achieve theoretical data rates of 1 gigabit per second (1 Gbps). It was introduced in
1999 and was defined by the IEEE 802.3ab standard.
Varieties of Gigabit Ethernet
The popular varieties of fast Ethernet are 1000Base-SX, 1000Base-LX, 1000BASE-T and
1000Base-CX.

Token Bus (IEEE 802.4) is a popular standard for the token passing LANs. In a token
bus LAN, the physical media is a bus or a tree and a logical ring is created using coaxial

21 | P a g e
cable. The token is passed from one user to other in a sequence (clockwise or
anticlockwise). Each station knows the address of the station to its “left” and “right” as
per the sequence in the logical ring. A station can only transmit data when it has the
token. The working of token bus is somewhat similar to Token Ring.

IEEE 802.5 Token Ring:Token ring is the IEEE 802.5 standard for a token-passing
ring in Communication networks. A ring consists of a collection of ring interfaces
connected by point-to-point lines i.e. ring interface of one station is connected to the ring
interfaces of its left station as well as right station. Internally, signals travel around the
Communication network from one station to the next in a ring.

10. Leaky bucket algorithm:


In the network layer, before the network can make Quality of service guarantees, it must
know what traffic is being guaranteed. One of the main causes of congestion is that traffic
is often bursty.
To understand this concept first we have to know little about traffic shaping. Traffic
Shaping is a mechanism to control the amount and the rate of the traffic sent to the

22 | P a g e
network. Approach of congestion management is called Traffic shaping. Traffic shaping
helps to regulate rate of data transmission and reduces congestion.
There are 2 types of traffic shaping algorithms:
1. Leaky Bucket
2. Token Bucket
Suppose we have a bucket in which we are pouring water in a random order but we have
to get water in a fixed rate, for this we will make a hole at the bottom of the bucket. It
will ensure that water coming out is in a some fixed rate, and also if bucket will full we
will stop pouring in it.
The input rate can vary, but the output rate remains constant. Similarly, in networking, a
technique called leaky bucket can smooth out bursty traffic. Bursty chunks are stored in
the bucket and sent out at an average rate.

In the figure, we assume that the network has committed a bandwidth of 3 Mbps for a
host. The use of the leaky bucket shapes the input traffic to make it conform to this
commitment. In Figure the host sends a burst of data at a rate of 12 Mbps for 2 s, for a
total of 24 Mbits of data. The host is silent for 5 s and then sends data at a rate of 2 Mbps
for 3 s, for a total of 6 Mbits of data. In all, the host has sent 30 Mbits of data in 10 s. The
leaky bucket smooths the traffic by sending out data at a rate of 3 Mbps during the same
10 s.
Without the leaky bucket, the beginning burst may have hurt the network by consuming
more bandwidth than is set aside for this host. We can also see that the leaky bucket may
prevent congestion.

A simple leaky bucket algorithm can be implemented using FIFO queue. A FIFO queue
holds the packets. If the traffic consists of fixed-size packets (e.g., cells in ATM
networks), the process removes a fixed number of packets from the queue at each tick of
the clock. If the traffic consists of variable-length packets, the fixed output rate must be
based on the number of bytes or bits.

The following is an algorithm for variable-length packets:

23 | P a g e
1. Initialize a counter to n at the tick of the clock.
2. If n is greater than the size of the packet, send the packet and decrement the counter by
the packet size. Repeat this step until n is smaller than the packet size.
3. Reset the counter and go to step 1.
Example – Let n=1000

Packet=
since n> front of Queue i.e. n>200
Therefore, n=1000-200=800
Packet size of 200 is sent to the network.

Now Again n>front of the queue i.e. n > 400


Therefore, n=800-400=400
Packet size of 400 is sent to the network.

Since n< front of queue


Therefore, the procedure is stop.
Initialize n=1000 on another tick of clock.
This procedure is repeated until all the packets are sent to the network.
Some advantage of token Bucket over leaky bucket –
 If bucket is full in token Bucket, tokens are discard not packets. While in leaky bucket,
packets are discarded.

24 | P a g e
 Token Bucket can send large bursts at a faster rate while leaky bucket always sends packets
at constant rate.

25 | P a g e

You might also like