0% found this document useful (0 votes)
21 views489 pages

Elements of Computer Networking - 1

Uploaded by

VimalRajan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views489 pages

Elements of Computer Networking - 1

Uploaded by

VimalRajan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Elements of

Computer Networking
An Integrated Approach

By
Narasimha Karumanchi
Dr. A. Damodaram
Dr. M. Sreenivasa Rao

CONCEPTS PROBLEMS INTERVIEW QUESTIONS


Copyright ©2020 by

All rights reserved.


Designed by ℎ ℎ

Copyright ©2020 CareerMonk Publications. All rights reserved.

All rights reserved. No part of this book may be reproduced in any form or by any
electronic or mechanical means, including information storage and retrieval systems,
without written permission from the publisher or author.
Acknowledgements
ℎ and ℎ , it is impossible to thank you adequately for everything you have
done, from loving me unconditionally to raising me in a stable household, where you
persistent efforts traditional values and taught your children to celebrate and embrace
life. I could not have asked for better parents or role-models. You showed me that
anything is possible with faith, hard work and determination.
This book would not have been possible without the help of many people. I would like to
thank them for their efforts in improving the end result. Before we do so, however, I
should mention that I have done my best to correct the mistakes that the reviewers
have pointed out and to accurately describe the protocols and mechanisms. I alone am
responsible for any remaining errors.
First and foremost, I would like to express my gratitude to many people who saw me
through this book, to all those who provided support, talked things over, read, wrote,
offered comments, allowed me to quote their remarks and assisted in the editing,
proofreading and design. In particular, I would like to thank the following individuals.
 , Senior Consultant, Juniper Networks Pvt. Ltd.
 ℎ, Lecturer, Nagarjuna Institute of Technology and Sciences, MLG

- ℎ ℎ
M. Tech,
Founder, .
Other Titles by Narasimha Karumanchi
Data Structures and Algorithms Made Easy
Data Structures and Algorithms for GATE
Data Structures and Algorithms Made Easy in Java
Coding Interview Questions
Peeling Design Patterns
IT Interview Questions
Data Structure and Algorithmic Thinking with Python
Preface
Dear Reader,
Please Hold on! We know many people do not read the preface. But we would strongly
recommend that you go through the preface of this book at least.
There are hundreds of books on computer networking already flooding the market. The
reader may naturally wonder what the need of writing another book on computer
networking is!
This book assumes you have basic knowledge about computer science. Main objective
of the book is to provide you the of and ℎ
questions. Before writing the book, we set ourselves the following :
 The book be written in ℎ that readers without any background in
computer networking should be able to understand it and .
 The book should present the concepts of in
and straightforward manner with a − explanation.
 The book should provide enough examples so that readers get better
understanding of the and also useful for the interviews.
We mean, the book should cover interview questions.
Please remember, the books which are available in the market are lacking one or many
of these goals. Based on my teaching and industrial experience, we thought of writing
this book aiming at achieving these goals in a simple way. A 3-stage formula is used in
writing this book, i.e.
+ +
We used very simple language such that a school going student can also understand
the concepts easily. Once the concept is discussed, it is then interlaced into problems.
The solutions of each and every problem are well explained.
Finally, interview questions with answers on every concept are covered. All the interview
questions in this book are collected from various interviews conducted by top software
development companies.
This book talks about networks in everyday terms. The language is friendly; you don’t
need a graduate education to go through it.
As a job seeker if you read complete book with good understanding, we are sure you will
challenge the interviewers and that is the objective of this book.
This book is very much useful for the students of engineering degree and masters
during their academic course. All the chapters of this book contain theory and their
related problems. If you read as a student preparing for competition exams (e.g. GATE),
content of this book covers all the required topics in full details.
It is that, at least reading of this book is required to get full
understanding of all the topics. In the readings, you can directly go to any
chapter and refer. Even though, enough readings were given for correcting the errors,
due to human tendency there could be some minor typos in the book.
If any such typos found, they will be updated at . . We request you to
constantly monitor this site for any corrections, new problems and solutions. Also,
please provide your valuable suggestions at: @ . .
Wish you all the best. We are sure that you will find this book useful.

ℎ ℎ Dr. A. Dr. M.
M. Tech, [Link]. (C.S.E.), Ph.D. (C.S.E) Dean MSIT Programme,
Founder, . Director, School of IT [Link]. (C.S.E.), Ph.D. (C.S.E)
Director, School of IT
Table of Contents

1. Organization of Chapters -------------------------------------------------------- 13


1.1 Why Computer Networks are needed? -------------------------------------------------- 13
1.2 What Is this Book About? ----------------------------------------------------------------- 13
1.3 Should I Take this Book? ----------------------------------------------------------------- 14
1.4 How to Use this book? --------------------------------------------------------------------- 14
1.5 Organization of Chapters ----------------------------------------------------------------- 14

2. Introduction------------------------------------------------------------------------ 19
2.1 What is a Computer Network? ----------------------------------------------------------- 19
2.2 Basic Elements of Computer Networks ------------------------------------------------- 19
2.3 What is an Internet? ----------------------------------------------------------------------- 20
2.4 Fundamentals of Data and Signals------------------------------------------------------ 20
2.5 Network Topologies ------------------------------------------------------------------------ 24
2.6 Network Operating Systems -------------------------------------------------------------- 28
2.7 Transmission Medium --------------------------------------------------------------------- 29
2.8 Types of Networks -------------------------------------------------------------------------- 31
2.9 Connection-oriented and Connectionless services ------------------------------------ 34
2.10 Segmentation and Multiplexing -------------------------------------------------------- 35
2.11 Network Performance -------------------------------------------------------------------- 35
2.12 Network Switching------------------------------------------------------------------------ 42
Problems and Questions with Answers------------------------------------------------------ 48

3. OSI and TCP/IP Models ---------------------------------------------------------- 57


3.1 Why OSI Model? ---------------------------------------------------------------------------- 57
3.2 What is a Protocol-Stack?----------------------------------------------------------------- 57
3.3 OSI Model ----------------------------------------------------------------------------------- 58
3.4 TCP/IP Model ------------------------------------------------------------------------------- 62
3.5 Difference between OSI and TCP/IP models ------------------------------------------- 65
3.6 How does TCP/IP Model (Internet) work? ---------------------------------------------- 66
3.7 Understanding Ports ----------------------------------------------------------------------- 68
Problems and Questions with Answers------------------------------------------------------ 69

4. Networking Devices --------------------------------------------------------------- 74


4.1 Glossary ------------------------------------------------------------------------------------- 74
4.2 End Devices --------------------------------------------------------------------------------- 75
4.3 Intermediary Devices ---------------------------------------------------------------------- 75
4.4 Internetworking Devices ------------------------------------------------------------------ 80
Problems and Questions with Answers------------------------------------------------------ 98

5. LAN Technologies ---------------------------------------------------------------- 101


5.1 Introduction -------------------------------------------------------------------------------- 101
5.2 Types of Network Links------------------------------------------------------------------- 102
5.3 Medium Access Control Techniques --------------------------------------------------- 103
5.4 Random Access Techniques ------------------------------------------------------------- 104
5.5 Static Channelization Techniques ------------------------------------------------------ 116
5.6 LocalTalk ----------------------------------------------------------------------------------- 128
5.7 Ethernet ------------------------------------------------------------------------------------ 128
5.8 Token Ring --------------------------------------------------------------------------------- 135
5.9 Error Detection Techniques ------------------------------------------------------------- 144
Problems and Questions with Answers----------------------------------------------------- 152

6. ARP and RARP -------------------------------------------------------------------- 161


6.1 Address Resolution Protocol [ARP] ----------------------------------------------------- 161
6.2 Reverse Address Resolution Protocol [RARP] ----------------------------------------- 166
Problems and Questions with Answers----------------------------------------------------- 168

7. IP Addressing --------------------------------------------------------------------- 170


7.1 Introduction -------------------------------------------------------------------------------- 170
7.2 What is an IP Address? ------------------------------------------------------------------- 171
7.3 Understanding IP Address --------------------------------------------------------------- 171
7.4 Why do we need IP addresses? ---------------------------------------------------------- 172
7.5 IPv4 and IPv6 ------------------------------------------------------------------------------ 173
7.6 Classful Addressing: IPv4 Address Classes ------------------------------------------- 174
7.7 IPv4 Addressing Types-------------------------------------------------------------------- 176
7.8 IPv4 Reserved Addresses ----------------------------------------------------------------- 177
7.9 Packet Flow in an IPv4 Network -------------------------------------------------------- 178
7.10 IPv4 Datagram Header Format -------------------------------------------------------- 180
7.11 IPv4 Fragmentation --------------------------------------------------------------------- 182
7.12 Limitations to IPv4 Classful Addressing --------------------------------------------- 183
7.13 Subnet Masks and Subnetting -------------------------------------------------------- 184
7.14 Supernetting and Classless Inter-Domain Routing [CIDR]------------------------ 194
7.15 Variable Length Subnet Mask [VLSM] ------------------------------------------------ 200
7.16 IPv6 [Internet Protocol Version 6] ----------------------------------------------------- 201
7.16.1 What is IPv6? -------------------------------------------------------------------------- 201
7.16.2 Why new IP Version? ----------------------------------------------------------------- 201
7.17 IPv6 Features ----------------------------------------------------------------------------- 202
7.18 Hexadecimal Number System---------------------------------------------------------- 203
7.19 IPv6 Addressing Notation [IPv6 Address Structure] -------------------------------- 204
7.20 IPv6 Prefixes ------------------------------------------------------------------------------ 206
7.21 IPv6 Subnets ----------------------------------------------------------------------------- 206
7.22 IPv6 Addressing Types ------------------------------------------------------------------ 207
7.23 Unicast IPv6 addresses ----------------------------------------------------------------- 208
7.24 Multicast IPv6 addresses --------------------------------------------------------------- 209
7.25 Anycast IPv6 addresses ----------------------------------------------------------------- 209
7.26 IPv6 Datagram Header Format -------------------------------------------------------- 209
Problems and Questions with Answers----------------------------------------------------- 211

8. IP Routing ------------------------------------------------------------------------- 224


8.1 Introduction -------------------------------------------------------------------------------- 224
8.2 What are Routing Algorithms? ---------------------------------------------------------- 229
8.3 Classification of Routing Algorithms --------------------------------------------------- 229
8.4 Routing Algorithm Metrics --------------------------------------------------------------- 232
8.5 Flooding Routing Algorithm ------------------------------------------------------------- 233
8.6 Internet architecture---------------------------------------------------------------------- 234
8.7 Routing protocols ------------------------------------------------------------------------- 235
8.8 Routing Information Protocol [RIP] ----------------------------------------------------- 236
8.9 Open Shortest Path First [OSPF] ------------------------------------------------------- 244
8.10 Border Gateway Protocol [BGP]-------------------------------------------------------- 259
Problems and Question with Answers ------------------------------------------------------ 270

9. TCP and UDP --------------------------------------------------------------------- 276


9.1 Introduction -------------------------------------------------------------------------------- 276
9.2 TCP and UDP ------------------------------------------------------------------------------ 278
9.3 TCP/IP Terminology ---------------------------------------------------------------------- 278
9.4 Ports and Sockets ------------------------------------------------------------------------- 279
9.5 User Datagram Protocol [UDP] ---------------------------------------------------------- 282
9.6 Transmission Control Protocol [TCP] --------------------------------------------------- 288
9.7 Comparison of TCP and UDP ------------------------------------------------------------ 303
9.8 Why Some TCP/IP Applications Use UDP?-------------------------------------------- 305
Problems and Question with Answers ------------------------------------------------------ 305

10. TCP Error Control ---------------------------------------------------------------- 315


10.1 Introduction ------------------------------------------------------------------------------ 315
10.2 TCP Reliability and Acknowledgement ----------------------------------------------- 315
10.3 Round Trip Time and Timeout--------------------------------------------------------- 316
10.4 Duplicate Segments --------------------------------------------------------------------- 319
10.5 Out-of-Order Segments ----------------------------------------------------------------- 320
10.6 Lost or Missing Segments -------------------------------------------------------------- 320
10.7 Corrupted Segments -------------------------------------------------------------------- 321
10.8 ARQ Retransmission Techniques ----------------------------------------------------- 321
10.9 Selective Acknowledgments (SACK) --------------------------------------------------- 323
10.10 TCP Checksum Calculation ---------------------------------------------------------- 325
Problems and Question with Answers ------------------------------------------------------ 330

11. TCP Flow Control----------------------------------------------------------------- 335


11.1 Introduction ------------------------------------------------------------------------------ 335
11.2 What is Flow Control? ------------------------------------------------------------------ 335
11.3 Flow Control and Error Control ------------------------------------------------------- 335
11.4 TCP and Flow Control ------------------------------------------------------------------- 336
11.5 Stop and Wait Flow Control ------------------------------------------------------------ 336
11.6 Positive Acknowledgment and Retransmission (PAR) ------------------------------ 337
11.7 Sliding Window Mechanism in Data Transmission -------------------------------- 338
11.8 Flow Control with Advertised Window ------------------------------------------------ 341
11.9 Segmentation and Nagling ------------------------------------------------------------- 343
Problems and Questions with Answers----------------------------------------------------- 346

12. TCP Congestion Control --------------------------------------------------------- 349


12.1 Introduction ------------------------------------------------------------------------------ 349
12.2 What is Network Congestion?---------------------------------------------------------- 349
12.3 Types of Congestion --------------------------------------------------------------------- 350
12.4 An Overview of TCP Flow Control ----------------------------------------------------- 350
12.5 Flow Control versus Congestion Control --------------------------------------------- 353
12.6 TCP Self-Clocking ------------------------------------------------------------------------ 353
12.7 Congestion Collapse Problem ---------------------------------------------------------- 354
12.8 Life of a TCP Connection Flow --------------------------------------------------------- 355
12.9 Congestion Avoidance versus Congestion Control---------------------------------- 356
12.10 TCP Congestion Control Techniques ------------------------------------------------ 357
12.11 TCP Congestion Avoidance Techniques--------------------------------------------- 360
12.12 Packet Discard Techniques ----------------------------------------------------------- 363
12.13 Traffic Shaping Algorithms ----------------------------------------------------------- 364
Problems and Questions with Answers----------------------------------------------------- 368

13. Session Layer --------------------------------------------------------------------- 375


13.1 Introduction ------------------------------------------------------------------------------ 375
13.2 What does Session Layer mean? ------------------------------------------------------ 376
13.3 Session Layer Tasks --------------------------------------------------------------------- 376
13.4 Session Layer Services ------------------------------------------------------------------ 376
13.5 Remote Procedure Call (RPC) Protocol------------------------------------------------ 378
13.6 Major Session Layer Protocols --------------------------------------------------------- 382

14. Presentation Layer Protocols --------------------------------------------------- 384


14.1 Introduction ------------------------------------------------------------------------------ 384
14.2 What does Presentation Layer mean? ------------------------------------------------ 385
14.3 Presentation Layer Tasks --------------------------------------------------------------- 385
14.4 Data Conversion ------------------------------------------------------------------------- 385
14.5 Data Representation -------------------------------------------------------------------- 386
14.6 Data Compression ----------------------------------------------------------------------- 387
14.7 Data Encryption ------------------------------------------------------------------------- 390
Problems and Questions with Answers----------------------------------------------------- 392

15. Network Security ----------------------------------------------------------------- 393


15.1 What is Network Security? ------------------------------------------------------------- 393
15.2 Relevant History of Instances ---------------------------------------------------------- 393
15.3 Why Do We Need Security? ------------------------------------------------------------ 394
15.4 What network security reports say? -------------------------------------------------- 394
15.5 History of Network Security ------------------------------------------------------------ 395
15.6 Four Pillars of Network Security ------------------------------------------------------ 395
15.7 Glossary of Network Security Terms-------------------------------------------------- 396
15.8 Network Security Components -------------------------------------------------------- 401
15.9 Types of Attacks ------------------------------------------------------------------------- 403
15.10 Discussion of known Security Attacks---------------------------------------------- 404
15.11 Cryptography --------------------------------------------------------------------------- 411
15.12 Types of Ciphers------------------------------------------------------------------------ 414
15.13 Encryption and Decryption ----------------------------------------------------------- 415
15.14 Hashing: Message Integrity ----------------------------------------------------------- 421
15.15 Digital Signatures ---------------------------------------------------------------------- 424
15.16 Kerberos Authentication System ---------------------------------------------------- 432
15.17 Firewalls --------------------------------------------------------------------------------- 442
Problems and Questions with Answers----------------------------------------------------- 454

16. Application Layer Protocols ----------------------------------------------------- 459


16.1 Introduction ------------------------------------------------------------------------------ 459
16.2 Hypertext Transfer Protocol [HTTP] --------------------------------------------------- 461
16.3 Simple Mail Transfer Protocol [SMTP] ------------------------------------------------ 463
16.4 File Transfer Protocol [FTP] ------------------------------------------------------------ 465
16.5 Domain Name Server [DNS] ------------------------------------------------------------ 468
16.6 Trivial File Transfer Protocol [TFTP] -------------------------------------------------- 473
16.7 Dynamic Host Configuration Protocol [DHCP] -------------------------------------- 473
Problems and Questions with Answers----------------------------------------------------- 479

17. Miscellaneous Concepts --------------------------------------------------------- 485


17.1 How traceroute (or tracert) works?---------------------------------------------------- 485
17.2 How ping works?------------------------------------------------------------------------- 485
17.3 What is QoS? ----------------------------------------------------------------------------- 486
17.4 Wireless Networking --------------------------------------------------------------------- 487
Problems and Questions with Answers----------------------------------------------------- 488
References ----------------------------------------------------------------------------- 489
Elements of Computer Networking Organization of Chapters

Chapter

Organization of
Chapters 1
1.1 Why Computer Networks are needed?
Computer networking is one of the most exciting and important technical fields of our
time. Information and communication are two of the most important strategic issues for
the success of every enterprise.
is the mother of invention, and whenever we really need something, humans
will find a way to get it. Let us imagine we do not have computer networking in our lives
now. People can communicate only with each other through phone (or fax). For
example, sharing a printer between many computers will be difficult as printer cable
must be attached to the computer which requires printing. Removable media such as
diskettes or thumb drives must be used in order to share files or to transfer files from
one machine to another machine.
Just imagine you need to transfer a file to one thousand computers. To these
problems, computer networks are . Computer networks allow the user to
access and either of the same organization or from
other enterprises or public sources. Computer networks provide faster communication
than other facilities. Many applications or software’s are also developed for enhancing
communication. Some examples are Email, Instance Messages, and internet phone.

1.2 What Is this Book About?


A unique feature of this book that is missing in most of the available books on
computer networking is to offer a balance between theoretical, practical concepts,
problems and interview questions.
+ +
This text provides academic researchers, graduate students in computer science,
computer engineering, and electrical engineering, as well as practitioners in industry
and research engineers with an understanding of the specific design challenges and
solutions for computer networks.
 Covers architecture and communications protocols in detail with practical
implementation examples and case studies.
 Provides an understanding of mutual relationships and dependencies between
different protocols and architectural decisions.

1.1 Why Computer Networks are needed? 13


Elements of Computer Networking Organization of Chapters

 Offers an in-depth investigation of relevant protocol mechanisms.


The book offers a large number of questions to practice each exam objective and will
help you assess your knowledge before you write the real exam. The detailed answers to
every question will help reinforce your knowledge about different issues involving the
design and configuration of networks.

1.3 Should I Take this Book?


This book is for a first course on computer networking. Although this book is more
precise and analytical than many other introductory computer networking text books, it
rarely uses any mathematical concepts that are not taught in high school.
I have made an effort to avoid using any advanced calculus, probability, or stochastic
process concepts. The book is therefore appropriate for undergraduate courses,
preparation and for first-year graduate courses.
This book is for students who to learn networking concepts and also for those who
are preparing for competitive exams like GATE.

1.4 How to Use this book?


I would like to recommend at least two readings of this book. Upon first reading, you
will start to being used in different networking enviroments.
In the second reading, you'll begin to see how these protocols can help you in your own
network designs, and may also start to see new protocols not listed in the book.
One of the most valuable contributions of this book is that it is designed not merely to
help you identify protocols, but to give you a sense of which protocols are appropriate in
which contexts.
In the subsequent readings, you can directly go to any chapter and refer.

1.5 Organization of Chapters


The chapter of this text book presents an overview of computer networking. This
chapter introduces many key concepts and terminology and sets the stage for the rest
of the book.
After completion of chapter, I recommend reading remaining chapters in
sequence. Each of these chapters leverages material from the preceding chapters. There
are no major inter-dependencies among the chapters, so they can be read in any order.
The chapters are arranged in the following way:
3. / : This chapter gives an introduction and necessary
concepts of Open Systems Interconnection (OSI) and Transmission Control
Protocol/Internet Protocol (TCP/IP) models which are used in all the remaining
chapters. There are seven layers in the OSI Model, and four in the TCP/IP
model. This is because TCP/IP assumes that applications will take care of
everything beyond the Transport layer. It also compares both these models.
4. : This chapter provides detailed overview of networking
devices such as hubs, bridges, switches, routers, gateways, firewalls etc... Hubs,
switches, routers, and access points are to connect computers together on
a network, but each of them has different capabilities. Each of these devices
operates at different layers in OSI and TCP/IP models.
5. ℎ : Local Area Network (LAN) in a data communications network
is a technology used for connecting terminals, computers and printers within a
building or other geographically limited areas. This chapter discusses medium

1.3 Should I Take this Book? 14


Elements of Computer Networking Organization of Chapters

access control techniques, random access techniques, static channelization


techniques, LocalTalk, Ethernet, Token Ring and ends with error detection
techniques at data link layer.
6. : This chapter focuses on protocols which does the translation of IP
addresses to MAC addresses and vice versa. ARP translates IP addresses into
hardware addresses (MAC) and RARP translates machines addresses (MAC) into
IP addresses.
7. : This chapter discusses about basics of IPv4 and IPv6 addressing.
It provides - ℎ analysis of classes of IP addressing, subnet masks,
subnetting, supernetting, Classless Inter-Domain Routing [CIDR], Variable
Length Subnet Mask [VLSM], and message formats of both IPv4 and IPv6.
8. : This chapter presents different network routing protocols. It starts
with overview of network routing and their classification. The protocols which
were discussed in this chapter includes Flooding Routing Algorithm, Routing
Information Protocol, Open Shortest Path First [OSPF], and Border Gateway
Protocol.
9. : In the earlier chapters, we discuss about the delivery of data in the
following two ways:
1. - - : At the - level, delivery of frames take
place between two nodes connected by a point-to-point link or a LAN,
by using the data-link layers address, say MAC address.
2. - -ℎ : At the level, delivery of datagrams can
take place between two hosts by using IP address.
From user’s point of view, the TCP/IP-based Internet can be considered as a set
of application programs that use the Internet to carry out useful
communication tasks. Most popular internet applications include Electronic
mail (E-mail), File transfer, and Remote login. IP routing allows transfer of IP
datagrams among a number of stations or hosts, where the datagram is routed
through the Internet based on the IP address of the destination. But, in this
case, several ( ) running simultaneously on a
source host has to communicate with the corresponding processes running on
a remote destination host through the Internet. This requires an additional
mechanism called - - delivery, which is implemented with the
help of a - protocol.
The transport level protocol will require an additional address, called
number, to select a particular process among multiple processes running on
the destination host. So, there is a requirement of the following third type of
delivery system.
3. Process-to-process delivery: At the transport level, communication can
take place between processes or application programs by using port
addresses
The additional mechanism needed to facilitate multiple application programs in
different stations to communicate with each other simultaneously can be
provided by a transport level protocol such as UDP or TCP, which is the topic of
this chapter.
10. : TCP is a reliable transport layer protocol. It allows the
processes to deliver a stream of data (bytes) in order, without error, and without
any part lost or duplicated. It provides mechanisms for detecting errors in:
 Duplicate segments
 Out-of-Order segments
 Lost or Missing segments
 Corrupted segments

1.5 Organization of Chapters 15


Elements of Computer Networking Organization of Chapters

Also, TCP provides a mechanism for error correction. In TCP, error detection and
correction in TCP is achieved by:
1. Checksum
2. Acknowledgement
3. Timeout and retransmission
In this chapter, we discuss several error control algorithms such as Stop and
Wait ARQ, Go Back N ARQ, Selective Reject ARQ etc...
11. : TCP provides a way for the receiver to control the amount of
data sent by the sender. Nodes that send and receive TCP data segments can
operate at different data rates because of differences in CPU and network
bandwidth. As a result, it is possible for sender to send data at a faster rate than
the receiver can handle.
If the receiver is slower than the sender, bytes will have to be dropped from the
receiver’s sliding window buffer. TCP deals with this issue using what is known
as .
As an example, consider a conversation with your friend. One of you listens
while the other speaks. You might nod your head as you listen or you might
interrupting the flow with a "Whoa, slow down, you are talking too fast!" This is
actually flow control. Some of us are better at it than others, but we all do it to
some degree. You nod to indicate you understood and are ready for the next
statement of information or you tell your friend when they are going too fast.
That's control.
This chapter focuses on such controlling algorithms for computer networks
( mechanism, and ).
12. : In today’s world, the (TCP)
carries huge Internet traffic, so performance of the Internet depends to a great
extent on how well TCP works. TCP provides a reliable transport service between
two processes running on source and destination nodes.
In this chapter, we discuss another important component of TCP;
mechanism. The important strategy of TCP is to send packets into the
network and then to react to that occur. TCP congestion
control was introduced into the Internet in the late 1980s by ;
roughly eight years after the TCP/IP protocol stack had become operational.
To address these issues, multiple mechanisms were implemented in TCP to
govern the rate with which the data can be sent in both directions (
and ): , , and
. These are the subject of this chapter.
13. : The session layer resides above the transport layer, and provides
value added services to the underlying transport layer services. The session
layer (along with the presentation layer) adds services to the transport layer that
are likely to be of use to applications, so that each application doesn't have to
provide its own implementation. Layer 5 of the OSI reference model is session
layer. It does not add many communications features/functionality, and is thus
termed a very thin layer. On many systems, the Layer 5 features are disabled,
but you should nonetheless know what failures can be prevented by a session
layer.
The session layer provides the following services:
I. Dialog management
II. Synchronization
III. Activity management
IV. Exception handling
This chapter ends with discussion on major session layer protocols such as
AppleTalk Data Stream Protocol (ADSP), AppleTalk Session Protocol (ASP),

1.5 Organization of Chapters 16


Elements of Computer Networking Organization of Chapters

Network Basic Input Output (NetBIOS), Password Authentication Protocol (PAP),


Remote Procedure Call Protocol (RPC), and Secure Shell (SSH) Protocol
14. : The presentation layer is the sixth layer of the OSI
model. It responds to service requests from the application layer and issues
service request to the session layer. The presentation layer performs certain
functions that are requested sufficiently often to finding a general solution for
users, rather than letting each user solve the problems. In particular, unlike all
the lower layers, which are just interested in moving bits reliably from here to
there, the presentation layer is concerned with the syntax and semantics of the
information transmitted.
In this chapter we discuss about encryption and decryption concepts. Also, we
look at an example encryption algorithm: coding algorithm.
15. : Network security refers to a set of activities and policies used
by a network administrator to prevent and monitor unauthorized access of a
computer network. These activities include protecting the usability, reliability,
integrity, and safety of computer network and data.
This chapter starts with a history of network security instances followed by
glossary of security terms. Then, we discuss about network security components
such as:
 Authentication
 Authorization
 Data Integrity
 Confidentiality
 Availability
 Non-Repudiation
It also focuses on different types of network security attacks. This followed with
discussion on cipher algorithms, in detailed analysis of encryption and
decryption algorithms, message integrity, digital signatures, and Kerberos
authentication system.
16. : The application layer of the OSI model provides the
first step of getting data onto the network. Application software is the software
programs used by people to communicate over the network. Examples of
application software are HTTP, FTP, email, and others. Although the TCP/IP
protocol suite was developed prior to the definition of the OSI model, the
functionality of the TCP/IP application layer protocols fits into the framework of
the top three layers of the OSI model: application, presentation, and session.
In the OSI and TCP/IP models, information is passed from one layer to the next,
starting at the application layer on the transmitting host and proceeding down
the hierarchy to the physical layer, then passing over the communications
channel (physical link) to the destination host, where the information proceeds
back up the hierarchy, ending at the application layer.
The application layer is built on the transport layer and provides network
services to user applications. It provides the interface between the applications
we use to communicate and the underlying network over which our messages
are transmitted. Application layer protocols are used to exchange data between
programs running on the source and destination hosts.
Underlying
Application Application Layer protocol
Transport protocol
E-Mail SMTP TCP
Remote terminal access Telnet TCP
Web HTTP TCP
File transfer FTP TCP
Streaming multimedia HTTP (example: YouTube) TCP or UDP
1.5 Organization of Chapters 17
Elements of Computer Networking Organization of Chapters

Internet telephony RTP (example: Skype) Typically UDP


Internet chat IRC (Internet Relay Chat) TCP
DHCP (Dynamic Host
Host Configurations UDP
Configuration Protocol)
The application layer is built on the transport layer and provides network
services to user applications. It provides the interface between the applications
we use to communicate and the underlying network over which our messages
are transmitted. Application layer protocols are used to exchange data between
programs running on the source and destination hosts. In this chapter, we
discuss all the fore mentioned protocols in detail.
17. : This chapter covers other important topics of computer
networking (such as [QoS], operation,
basics etc.) even though they are out of scope of this book.
At the end of each chapter, a set of problems/questions are provided for you to
improve/check your understanding of the concepts. Wherever applicable, protocols are
compared with other similar protocols.
The examples in this book are kept simple for easy understanding. The objective is to
enhance the explanation of each concept with examples for a better understanding.

1.5 Organization of Chapters 18


Elements of Computer Networking Introduction

Chapter

Introduction 2
2.1 What is a Computer Network?
A computer network is a group of computers that are connected together and
communicate with one another. These computers can be connected by the telephone
lines, co-axial cable, satellite links or some other communication techniques.

2.2 Basic Elements of Computer Networks


More and more, it is networks that connect us. People communicate online from
everywhere. We focus on these aspects of the information network:
 Devices that make up the network (work stations, laptops, file servers, web
servers, network printers, VoIP phones, security cameras, PDAs, etc..)
 Media that connect the devices
 Messages that are carried over the network
 Rules (protocols) and processes that control network communications
 Tools and commands for constructing and maintaining networks

Medium Network
Devices
Message

Communication begins with a message that must be sent from one device to another.
People exchange ideas using many different communication methods. All of these
methods have ℎ elements in common.
 The first of these elements is the ( ). Message sources are
people, or electronic devices, that need to send a message to other
individuals/devices.
 The second element of communication is the ( ), of the
message. The destination receives the message and interprets it.

2.1 What is a Computer Network? 19


Elements of Computer Networking Introduction

 A third element, called a ℎ , consists of the media that provides the


pathway over which the message can travel from source to destination.

Important Question
From the choices below, select the best definition of a network.
A. A collection of printers with no media.
B. Devices interconnected by some common communication channel.
C. A device that sends communication to the Internet.
D. A shared folder stored on a server.

Answer: B.

2.3 What is an Internet?


Connecting two or more networks together is called an . In other words, an
Internet is a network of networks.

2.4 Fundamentals of Data and Signals


and are two of the basic elements of any computer network. A signal is the
transmission of data. Both data and signals can be in either analog or digital form,
which gives us possible combinations:
1. Transmitting digital data using digital signals
2. Transmitting digital data using analog signals
3. Transmitting analog data using digital signals
4. Transmitting analog data using analog signals

2.4.1 Analog and Digital Data


Information that is stored within computer systems and transferred over a computer
network can be divided into two categories: data and signals. Data are entities that
convey meaning within a computer or computer system.
Data refers to information that conveys some meaning based on some mutually agreed
up rules or conventions between a sender and a receiver and today it comes in a variety
of forms such as text, graphics, audio, video and animation.
Data can be of two types:
 data
 data
2.3 What is an Internet? 20
Elements of Computer Networking Introduction

Analog data take values on some interval. Examples of analog data are voice
and video. The data that are collected from the real world with the help of transducers
are continuous-valued or analog in nature.
On the contrary, digital data take values. Text or character strings can be
considered as examples of digital data. Characters are represented by suitable codes,
e.g. ASCII code, where each character is represented by a 7-bit code.

2.4.2 Analog and Digital Signals


If we want to transfer this data from one point to another, either by using a
physical wire or by using radio waves, the data has to be converted into a signal.
Signals are the electric or electromagnetic encoding of data and are used to
transmit data.
Signals (electric signals) which run through conducting wires are divided into the
following two categories. Also, a system used when transmitting signals is called a
.

2.4.3 Analog Signals


Analog refers to physical quantities that vary continuously instead of discretely.
Physical phenomena typically involve analog signals. Examples include temperature,
speed, position, pressure, voltage, altitude, etc.
To say a signal is analog simply means that the signal is continuous in time and
amplitude. Take, for example, your standard mercury glass thermometer. This device is
analog because the temperature reading is updated constantly and changes at any time
interval.
A new value of temperature can be obtained whether you look at the thermometer one
second later, half a second later, or a millionth of a second later, assuming temperature
can change that fast.
Wave Length

Amplitude

Time
The readings from the thermometer are also continuous in amplitude. This means that
assuming your eyes are sensitive enough to read the mercury level, readings of 37,
37.4, or 37.440183432°C are possible. In actuality, most cardiac signals of interest are
analog by nature. For example, voltages recorded on the body surface and cardiac
motion is continuous functions in time and amplitude.
In this, signals 0 and 1 are transmitted as electric waves. A system of transmitting
analog signals is called system.

2.4.4 Digital Signals


Digital signals consist of patterns of bits of information. These patterns can be
generated in many ways, each producing a specific code. Modern digital computers
store and process all kinds of information as binary patterns. All the pictures, text,
2.4 Fundamentals of Data and Signals 21
Elements of Computer Networking Introduction

sound and video stored in this computer are held and manipulated as patterns of
binary values.

Time 

Basically, code 1 is transmitted when applying a specific voltage and code 0 is


transmitted in the case of 0 V. A system of transmitting digital signals is called
system.

2.4.5 Converting Data into Signals


Like data, signals can be analog or digital. Typically, digital signals convey digital data,
and analog signals convey analog data. However, we can use analog signals to convey
digital data and digital signals to convey analog data. The choice of using either analog
or digital signals often depends on the transmission equipment that is used and the
environment in which the signals must travel.

2.4.6 Data Codes


One of the most common forms of data transmitted between a sender and a receiver is
textual data. This textual information is transmitted as a sequence of characters. To
distinguish one character from another, each character is represented by a unique
binary pattern of 1s and 0s. The set of all textual characters or symbols and their
corresponding binary patterns is called a . Three important data codes are
EBCDIC, ASCII, and Unicode.

2.4.7 Frequency
Frequency describes the number of waves that pass a fixed place in a given amount of
time. So if the time it takes for a wave to pass is 1/2 second, the frequency is 2 per
second. If it takes 1/100 of an hour, the frequency is 100 per hour.
High frequency waves Low frequency waves

Usually frequency is measured in the ℎ unit, named in honor of the 19 -century


German physicist Heinrich Rudolf Hertz. The hertz measurement, abbreviated Hz, is the
number of waves that pass by per second.

2.4.8 Bit Rate


Two new terms, bit interval (instead of period) and bit rate (instead of frequency) are
used to describe digital signals. The bit interval is the time required to send one single
bit. The bit rate is the number of bit interval per second. This mean that the bit rate is
the number of bits send in one second, usually expressed in bits per second ( ) as
shown in figure.

2.4 Fundamentals of Data and Signals 22


Elements of Computer Networking Introduction

10 bits per second= 10 bps

1 0 1 1 1 0 0 0 1 0

Time 
The speed of the data is expressed in bits per second (bits/s, bits per second or bps).
The data rate is a function of the duration of the bit or bit time:
1
=

Rate is also called ℎ C. If the bit time is 10 , the data rate equals:
R= = 10 bps or 100 million bits/sec
×

This is usually expressed as 100 Mbits/s.

2.4.9 Baud Rate


The baud rate of a data communications system is the of per
transferred. A symbol may have more than two states, so it may represent more than
one binary bit (a binary bit always represents exactly two states). Therefore the baud
rate may not equal the bit rate, especially in the case of recent modems, which can have
(for example) up to nine bits per symbol.
Baud rate is a technical term associated with modems, digital televisions, and other
technical devices. It is also called as and . The term roughly
means the speed that data is transmitted, and it is a derived value based on the
number of symbols transmitted per second.
The units for this rate are either or . Baud can be
determined by using the following formula:

This can be used to translate baud into a bit rate using the following formula:
= ×
Baud can be abbreviated using the shortened form when being used for technical
purposes.
The significance of these formulas is that higher baud rates equate to greater amounts
of data transmission, as long as the bits per symbol are the same. A system using 4800
baud modems that has 4 bits per symbol will send less data than a system using 9600
baud modems that also has 4 bits per symbol. So, all other things being equal, a higher
rate is generally preferred.

2.4.10 Attenuation
(also called ) is a general term that refers to any reduction in the
strength of a signal. Attenuation occurs with any type of signal, whether digital or
analog. It usually occurs while transmitting analog or digital signals over long
distances.

2.4 Fundamentals of Data and Signals 23


Elements of Computer Networking Introduction

2.4.11 Signal to Noise Ratio


measures the level of the audio signal compared to the level of noise
present in the signal. Signal to noise ratio specifications are common in many
components, including amplifiers, phonograph players, CD/DVD players, tape decks
and others. Noise is described as hiss, as in tape deck, or simply general electronic
background noise found in all components.

How is it expressed?
As the name suggests, signal to noise ratio is a comparison or ratio of the amount of
signal to the amount of noise and is expressed in decibels. Signal to noise ratio is
abbreviated / and higher numbers mean a better specification. A component
with a signal to noise ratio of 100 dB means that the level of the audio signal is 100 dB
higher than the level of the noise and is a better specification than a component with a
S/N ratio of 90 dB.
Signal-to-noise ratio is defined as the power ratio between a signal and noise. It can be
derived from the formula
P µ
= =
P
where µ is the signal mean or expected value
the standard deviation of the noise

2.5 Network Topologies


In a computer network, the way in which the devices are linked is called .
Topology is the physical layout of computers, cables, and other components on a
network. Following are few types of topologies which we will look at:
• Bus topology
• Star topology
• Mesh topology
• Ring topology

2.5.1 Bus Topology


A bus topology uses one cable (also called a , a , and a ) to
connect multiple systems. Most of the time, T-connectors (because they are shaped like
the letter T) are used to connect to the cabled segment. Generally, coaxial cable is used
in bus topologies.
Another key component of a bus topology is the need for . To prevent
packets from bouncing up and down the cable, devices called must be
attached to both ends of the cable. A terminator absorbs an electronic signal and clears
the cable so that other computers can send packets on the network. If there is no
termination, the entire network fails.

Node

Link

Only one computer at a time can transmit a packet on a bus topology. Systems in a bus
topology listen to all traffic on the network but accept only the packets that are
addressed to them. Broadcast packets are an exception because all computers on the
network accept them. When a computer sends out a packet, it travels in both directions

2.5 Network Topologies 24


Elements of Computer Networking Introduction

from the computer. This means that the network is occupied until the destination
computer accepts the packet.
The number of computers on a bus topology network has a major influence on the
performance of the network. A bus is a passive topology. The computers on a bus
topology only listen or send data. They do not take data and send it on or regenerate it.
So if one computer on the network fails, the network is still up.

Advantages
One advantage of a bus topology is . The bus topology uses less cable than other
topologies. Another advantage is the ease of . With the bus topology, we
simply connect the system to the cable segment. We need only the amount of cable to
connect the workstations we have. The ease of working with a bus topology and the
minimum amount of cable make this the most economical choice for a network
topology. If a computer fails, the network stays up.

Disadvantages
The main disadvantage of the bus topology is the difficulty of ℎ . When the
network goes down, usually it is from a break in the cable segment. With a large
network this can be tough to isolate. A cable break between computers on a bus
topology would take the entire network down. Another disadvantage of a bus topology is
that the ℎ the traffic, the the network.
Scalability is an important consideration with the dynamic world of networking. Being
able to make changes easily within the size and layout of your network can be
important in future productivity or downtime. The bus topology is not very scalable.

2.5.2 Star Topology


In star topology, all systems are connected through one central hub or switch, as shown
in figure. This is a very common network scenario.

Link

Hub
Node

Advantages
One advantage of a start topology is the centralization of cabling. With a hub, if one link
fails, the remaining systems are not affected like they are with other topologies, which
we will look at in this chapter.
Centralizing network components can make an administrator’s life much easier in the
long run. Centralized management and monitoring of network traffic can be vital to
network success. With this type of configuration, it is also easy to add or change
configurations with all the connections coming to a central point.

Disadvantages
On the flip side to this is the fact that if the hub fails, the entire network, or a good
portion of the network, comes down. This is, of course, an easier fix than trying to find
a break in a cable in a bus topology.

2.5 Network Topologies 25


Elements of Computer Networking Introduction

Another disadvantage of a star topology is cost: to connect each system to a centralized


hub, we have to use much more cable than we do in a bus topology.

2.5.3 Ring Topology


In ring topology each system is attached nearby systems on a point to point basis so
that the entire system is in the form of a ring. Signals travel in one direction on a ring
topology.

Link

Node

As shown in figure, the ring topology is a circle that has no start and no end.
Terminators are not necessary in a ring topology. Signals travel in one direction on a
ring while they are passed from one system to the next. Each system checks the packet
for its destination and passes it on as a repeater would. If one of the systems fails, the
entire ring network goes down.

Advantages
The nice thing about a ring topology is that each computer has equal access to
communicate on the network. (With bus and star topologies, only one workstation can
communicate on the network at a time.) The ring topology provides good performance
for each system. This means that busier systems that send out a lot of information do
not inhibit other systems from communicating. Another advantage of the ring topology
is that signal degeneration is low.

Disadvantages
The biggest problem with a ring topology is that if one system fails or the cable link is
broken the entire network could go down. With newer technology this isn’t always the
case. The concept of a ring topology is that the ring isn’t broken and the signal hops
from system to system, connection to connection.
Another disadvantage is that if we make a cabling change to the network or a system
change, such as a move, the brief disconnection can interrupt or bring down the entire
network.

2.5.4 Mesh Topology

Link

Node

A mesh topology is not very common in computer networking. The mesh topology is
more commonly seen with something like the national phone network. With the mesh
topology, every system has a connection to every other component of the network.

2.5 Network Topologies 26


Elements of Computer Networking Introduction

Systems in a mesh topology are all connected to every other component of the network.
If we have 4 systems, we must have six cables— three coming from each system to the
other systems.
Two nodes are connected by dedicated point-point links between them. So the total
number of links to connect nodes would be
( )
[Proportional to ]

Advantages
The biggest advantage of a mesh topology is fault tolerance. If there is a break in a cable
segment, traffic can be rerouted. This fault tolerance means that the network going
down due to a cable fault is almost impossible.

Disadvantages
A mesh topology is very hard to administer and manage because of the numerous
connections. Another disadvantage is cost. With a large network, the amount of cable
needed to connect and the interfaces on the workstations would be very expensive.

2.5.5 Tree Topology

Repeater-1

Repeater-2 Repeater-3

This topology can be considered as an extension to bus topology. It is commonly used in


cascading equipment’s. For example, we have a repeater box with 8-port, as far as we
have eight stations, this can be used in a normal fashion. But if we need to add more
stations then we can connect two or more repeaters in a hierarchical format (tree
format) and can add more stations.
In the figure Repeater-1 refers to repeater one and so on and each repeater is
considered to have 8-ports.

2.5.6 Unconstrained Topology

All the topologies discussed so far are symmetric and constrained by well-defined
interconnection pattern. However, sometimes no definite pattern is followed and nodes
are interconnected in an arbitrary manner using point-to-point links.

2.5 Network Topologies 27


Elements of Computer Networking Introduction

Unconstrained topology allows a lot of configuration flexibility but suffers from the
complex routing problem. Complex routing involves unwanted overhead and delay.

2.6 Network Operating Systems


Network operating system NOS is an operating system that includes special functions
for connecting computers and devices into a local area network (LAN).
Few standalone operating systems, such as Microsoft Windows NT, can also act as
network operating systems. Some of the most well-known network operating systems
include Microsoft Windows Server 2003, Microsoft Windows Server 2008, Linux and
Mac OS X.

2.6.1 Peer-to-peer

Peer to Peer
Network

− − are more commonly implemented where less than ten


computers are involved and where strict security is not necessary. All computers have
the same status, hence the term , and they communicate with each other on an
equal footing. Files, such as word processing or spreadsheet documents, can be shared
across the network and all the computers on the network can share devices, such as
printers or scanners, which are connected to any one computer.

2.6.2 Client/server networks

File Server

Other
equipment

/ are more suitable for larger networks. A central computer, or


, acts as the storage location for files and applications shared on the network.
Usually the server is a higher than average performance computer.
The server also controls the network access of the other computers which are referred
to as the 'client' computers. Typically, teachers and students in a school will use the
client computers for their work and only the network administrator (usually a
designated staff member) will have access rights to the server [figure on right side].

2.6 Network Operating Systems 28


Elements of Computer Networking Introduction

2.7 Transmission Medium


Communication across a network is carried on a . The medium provides the
channel through which the data travels from source to destination. There are several
types of media, and the selection of the right media depends on many factors such as
cost of transmission media, efficiency of data transmission and the transfer rate.
Different types of network media have different features and benefits.

2.7.1 Two wire open line


This is the simplest of all the transmission media. It consists of a simple pair of metallic
wires made of copper or sometimes aluminums of between 0.4 and 1mm diameter, and
each wire is insulated from the other. There are variations to this simplest form with
several pairs of wire covered in a single protected cable called a or
molded in the form of a .

Example: Electric power transmission


This line consists of two wires that are generally spaced from 2 to 6 inches apart by
insulating spacers. This type of line is most often used for power lines.
This type of media is used for communication within a short distance, up to about 50
Meters, and can achieve a transfer rate of up to 19200 bits per second.

2.7.2 Twisted Pair cable


As the name implies, the line consists of two insulated wires twisted together to form a
flexible line without the use of spacers. It is not used for transmitting high frequency
because of the high dielectric losses that occur in the rubber insulation. When the line
is wet, the losses are high.
Twisted Pair cable is used for communication up a distance of 1 kilometer and can
achieve a transfer rate of up to 1-2 Mbps. But as the speed increased the maximum
transmission distances reduced, and may require repeaters.

Twisted pair cables are widely used in telephone network and are increasingly being
used for data transmission.

2.7.3 Co-axial Cable


Coaxial cable is the kind of copper cable used by cable TV operators between the
antenna and user homes. It is called because it includes one physical channel
that carries the signal surrounded (after a layer of insulation) by another concentric
physical channel, and both running along the same axis. The outer channel serves as a
ground.

2.7 Transmission Medium 29


Elements of Computer Networking Introduction

Larger the cable diameter, lower is the transmission loss, and higher transfer speeds
can be achieved. A co-axial cable can be used over a distance of about 1 KM and can
achieve a transfer rate of up to 100 Mbps.

2.7.4 Fiber Optic Cables


Fiber-based media use light transmissions instead of electronic pulses. Fiber is well
suited for the transfer of data, video, and voice transmissions. Also, fiber-optic is the
most secure of all cable media. Anyone trying to access data signals on a fiber-optic
cable must physically tap into the media and this is a difficult task.

On the flip side, difficult installation and maintenance procedures of fiber require
skilled technicians. Also, the cost of a fiber-based solution is more. Another drawback
of implementing a fiber solution involves cost for fitting to existing network
equipment/hardware. Fiber is incompatible with most electronic network equipment.
That means, we have to purchase fiber-compatible network hardware.
Fiber-optic cable is made-up of a core glass fiber surrounded by cladding. An insulated
covering then surrounds both of these within an outer protective sheath.
Since light waves give a much high bandwidth than electrical signals, this leads to high
data transfer rate of about 1000 Mbps. This can be used for long and medium distance
transmission links.

2.7.5 Radio, Microwaves and Satellite Channels


Radio, Microwaves and Satellite Channels use electromagnetic propagation in open
space. The advantage of these channels depends on their capability to cove large
geographical areas and being inexpensive than the wired installation.
The demarcation between radio, Microwave and satellite channels depends on the
frequencies in which they operate. Frequencies below 1000 MHZ are radio frequencies
and higher are the Microwave frequencies.
The radio frequency transmission may be below 30 MHZ or above 30 MHZ and thus the
techniques of transmission are different. Above 30MHz propagation is on − −
ℎ paths. Antennas are placed in between the line-of- sight paths to increase the
distance.
Radio frequencies are prone to attenuation and, thus, they require repeaters along the
path to enhance the signal. Radio frequencies can achieve data transfer rate of 100
Kbps to 400 Kbps.

2.7 Transmission Medium 30


Elements of Computer Networking Introduction

Microwave links use − − ℎ transmission with repeaters placed every 100-200


KM. Microwave links can achieve data transfer rates of about 1000 Mbps.
Satellite links use microwave frequencies in the order of 4-12 GHz with the satellite as a
repeater. They can achieve data transfer rates of about 1000 Mbps.

2.8 Types of Networks


2.8.1 Local Area Network [LAN]
A local area network (LAN) is a network confined to one location, one building or a
group of buildings. LAN's are composed of various components like desktops, printers,
servers and other storage devices. All hosts on a LAN have addresses that fall in a single
continuous and contiguous range.
LANs usually do not contain routers. LANs have higher communication and data
transfer rates. A LAN is usually administered by a single organization.

2.8.2 Metropolitan Area Network (MAN)


A metropolitan area network (MAN) is a large computer network that usually spans a
city or a large campus. Usually a MAN interconnects a number of local area networks
(LANs) using a high-capacity backbone technology (fibre-optical links). It is designed to
extend over an entire city. That means it can be a single network (for example, cable
television network) or connecting a number of LANs into a larger network.

A MAN may be fully owned and operated by a private company or be a service provided
by a public company.

Public City Network

2.8 Types of Networks 31


Elements of Computer Networking Introduction

2.8.3 Wide Area Network [WAN]


A wide area network (WAN) provides long-distance transmission of data, voice, image
and video information over large geographical areas that may comprise a country, or
even the whole world. WANs may utilize public, leased, or private communication
devices, usually in combinations, therefore span an unlimited number of miles.
A WAN that is wholly owned and used by a single company is often referred to as an
enterprise network. Maintaining WAN is difficult because of its wider geographical
coverage and higher maintenance costs. Internet is the best example of a WAN. WANs
have a lower data transfer rate as compared to LANs.

2.8.4 Personal Area Network


A personal area network (PAN) is a computer network organized around an individual
person. PANs usually involve a computer, a cell phone and/or a handheld computing
device such as a PDA.
We can use these networks to transfer files including email and calendar appointments,
digital photos and music. Personal area networks can be constructed with cables [for
example, USB] or be wireless [for example, Bluetooth].
Personal area networks generally cover a range of less than 10. PANs can be viewed as a
special type LAN that supports one person instead of a group.

Projector

File and Print Server


Mobile

Camera
Scanner
Printer

2.8.5 LAN vs. WAN


LAN WAN
LAN (Local Area Network) is a WAN (Wide Area Network) is a
Definition
computer network covering a computer network that covers a
2.8 Types of Networks 32
Elements of Computer Networking Introduction

small geographic area, like a broad area (e.g., any network


home, office, schools, or group whose communications links
of buildings. cross metropolitan, regional, or
national boundaries over a long
distance
Because it covers a relatively Maintaining WAN is difficult
Maintenance small geographical area, LAN is because of its wider geographical
costs easier to maintain at relatively coverage and higher maintenance
low costs. costs.
LANs tend to have fewer
WANs tend to be fewer faults
problems associated with
Fault tolerant as it consists of a large
them, as there are a smaller
Tolerance: number of systems there is a
number of systems to deal
lower amount of fault tolerance.
with.
Network in an organization can Internet is the best example of a
Example
be a LAN WAN
LANs will have a small
WANs generally spread across
Geographical geographical range and do not
boundaries and need leased
spread need any leased
telecommunication lines
telecommunication lines
In this case since networks in
remote areas have to be
If there is a need to set-up a
connected hence the set-up costs
couple of extra devices on the
Set-up costs are higher. However WANs using
network, it is not very
public networks can be setup
expensive to do that
very cheaply, just software (VPN
etc.)
WANs (like the Internet) are not
Typically owned, controlled, owned by any one organization
Ownership and managed by a single but rather exist under collective
person or organization or distributed ownership and
management over long +distances
Layers 3 devices Routers, Multi-
Layer 2 devices like switches,
layer Switches and Technology
Components bridges. layer1 devices like
specific devices like ATM or
hubs , repeaters
Frame-relay Switches etc.
Data transfer LANs have a high data transfer WANs have a lower data transfer
rates rate rate as compared to LANs
Tend to use certain WANs tend to use technology like
connectivity technologies, MPLS, ATM, Frame Relay and
Technology
primarily Ethernet and Token X.25 for connectivity over the
Ring longer distances
Computers connected to a WAN
One LAN can be connected to are often connected through
other LANs over any distance public networks, such as the
Connection
via telephone lines and radio telephone system. They can also
waves be connected through leased
lines or satellites
Speed High speed(1000mbps) Less speed(150mbps)

2.8 Types of Networks 33


Elements of Computer Networking Introduction

2.8.6 Wireless Networks


A wireless network is a computer network that uses a wireless network connection such
as Wi-Fi. In wireless networks, can have the following types:
 Wireless PAN (WPAN): interconnect devices within a relatively small area that is
generally within a person's reach.
 Wireless LAN (WLAN): interconnects two or more devices over a short distance
using a wireless distribution method. IEEE 802.11 standard describes about
WLAN.
 Wireless MAN (WMAN): connects multiple wireless LANs. IEEE 802.16 standard
describes about WMAN.
 Wireless WAN (WWAN): covers large areas, such as between neighboring towns
and cities, or city and suburb. The wireless connections between access points
are usually point to point microwave links using parabolic dishes, instead of
omnidirectional antennas used with smaller networks.

2.9 Connection-oriented and Connectionless services


There are two different techniques for transferring data in computer networks. Both
have advantages and disadvantages. They are the connection-oriented method and the
connectionless method:

2.9.1 Connection-oriented service


This requires a session connection be established before any data can be sent. This
method is often called a reliable network service. It guarantees that data will arrive in
the same order. Connection-oriented services set up virtual links between sender and
receiver systems through a network. Transmission Control Protocol (TCP) is a
connection-oriented protocol.
The most common example for the connection oriented service is the telephone system
that we use every day. In connection oriented system such as the telephone system, a
direct connection is established between you and the person at the other end.
Therefore, if you called from India to United States of America (USA) for 5 minutes, you
are in reality actually the owner of that copper wire for the whole 5 minutes. This
inefficiency however overcame by the multiple access techniques invented (refer
ℎ chapter).
Connection-oriented services set up path between source and destination
systems through a network. Connection-oriented service provides its services with the
following three steps:
1. ℎ : This is the process of establishing a connection to the desired
destination prior to the transfer of data. During this hand-shaking process, the
two end nodes decide the parameters for transferring data.
2. : During this step, the actual data is being sent in order.
Connection oriented protocol is also known as network service as it
provides the service of delivering the stream of data in order. It ensures this as
most of the connection oriented service tries to resend the lost data packets.
3. : This step is taken to release the end nodes and
resources after the completion of data transfer.

2.9.2 Connectionless Service


Connectionless service does not require a session connection between sender and
receiver. The sender simply starts sending packets (called ) to the destination.

2.9 Connection-oriented and Connectionless services 34


Elements of Computer Networking Introduction

This service does not have the reliability of the connection-oriented method, but it is
useful for periodic burst transfers.
Neither system must maintain state information for the systems that they send
transmission to or receive transmission from. A connectionless network provides
minimal services. User Datagram Protocol (UDP) is a connectionless protocol.
Common features of a connectionless service are:
 Data (packets) do not need to arrive in a specific order
 Reassembly of any packet broken into fragments during transmission must be
in proper order
 No time is used in creating a session
 No acknowledgement is required.

2.10 Segmentation and Multiplexing


In theory, a single communication, such as a music video or an e-mail message, could
be sent across a network from a source to a destination as one massive continuous
stream of bits. If messages were actually transmitted in this manner, it would mean
that no other device would be able to send or receive messages on the same network
while this data transfer was in progress.

These large streams of data would result in significant delays. Further, if a link in the
interconnected network infrastructure failed during the transmission, the complete
message would be lost and have to be retransmitted in full.
A better approach is to divide the data into smaller, more manageable pieces to send
over the network. This division of the data stream into smaller pieces is called
. Segmenting messages has two primary benefits.
, by sending smaller individual pieces from source to destination, many different
conversations can be interleaved on the network. The process used to interleave the
pieces of separate conversations together on the network is called .

, segmentation can increase the reliability of network communications. The


separate pieces of each message need not travel the same pathway across the network
from source to destination. If a particular path becomes congested with data traffic or
fails, individual pieces of the message can still be directed to the destination using
alternate pathways. If part of the message fails to make it to the destination, only the
missing parts need to be retransmitted.

2.11 Network Performance


Network performance has been the subject of much research over the past decades.
One important issue in networking is the performance of the network—how good is it?
Internet data is packaged and transported in pieces of data.
The flow of these small pieces of data directly affects a user’s internet experience. When
data packets arrive in a timely manner the user sees a continuous flow of data; if data
packets arrive with between packets the user’s experience is .

2.11.1 Round Trip Time


In TCP, when a host sends a segment (also called packet) into a TCP connection, it
starts a timer. If the timer expires before the host receives an acknowledgment for the

2.10 Segmentation and Multiplexing 35


Elements of Computer Networking Introduction

data in the segment, the host retransmits the segment. The time from when the timer is
started until when it expires is called the of the timer.
What should be the ideal be? Clearly, the timeout should be larger than the
connection's round-trip time, i.e., the time from when a segment is sent until it is
acknowledged.
Otherwise, unnecessary retransmissions would be sent. But the timeout should not be
much larger than the - ; otherwise, when a segment is lost, TCP would not
quickly retransmit the segment, thereby introducing significant data transfer delays
into the application. Before discussing the timeout interval in more detail, let us take a
closer look at the round-trip time ( ).
The round trip time calculation algorithm is used to calculate the average time for data
to be acknowledged. When a data packet is sent, the elapsed time for the
acknowledgment to arrive is measured and the mean deviation algorithm
is applied. This time is used to determine the interval to retransmit data.

[Link] Estimating the Average Round Trip Time


The sample RTT, denoted with , for a segment is the time from when the
segment is sent (i.e., passed to IP) until an acknowledgment for the segment is received.
Each segment sent will have its own associated .

Obviously, the values will change from segment to segment due to


congestion in the routers and to the varying load on the end systems. Because of this
fluctuation, any given value may be atypical. In order to estimate a typical
, it is therefore natural to take some sort of average of the values.
TCP maintains an average of values, denoted with called . Upon
receiving an acknowledgment and obtaining a new , TCP updates
according to the following formula:

= (1- ) * + *

The above formula is written in the form of a programming language statement - the
new value of is a weighted combination of the previous value of
and the new value for . A typical value of is = .1, in which
case the above formula becomes:

= .9 + .1

Note that is a weighted average of the values. This weighted


average puts more weight on recent samples than on old samples. This is natural, as
the more recent samples better reflect the current congestion in the network. In
statistics, such an average is called an ℎ ( ).
The word appears in EWMA because the weight of a given decays
exponentially fast as the updates proceed.

2.11.2 Causes for Latency?


Regardless of the speed of the processor or the efficiency of the software, it takes a finite
amount of time to manipulate and present data. Whether the application is a web page
showing the latest news or a live camera shot showing a traffic jam, there are many
ways in which an application can be affected by latency. Four key causes of latency are:
, , and ℎ , and and
.

2.11 Network Performance 36


Elements of Computer Networking Introduction

Packet Queuing delay Transmission delay

Next Router/Switch
or
Processing delay Destination
Processing delay

Router or Switch

= + + +

[Link] Propagation Delay


Propagation delay is the primary source of latency. It is a function of how long it
information to at the speed of light in the communications media from source to
destination. In free space, the speed of light is approximately 3 × 10 km/sec. The speed
of light is lower in other media such as copper wire or fiber optic cable. The amount of
slowing caused by this type of transmission is called the (VF).
Fiber optic cables typically measure around 70% of the speed of light whereas copper
cable varies from 40% to 80% depending on the construct. Coaxial cable is commonly
used and many types have a VF of 66%.
Satellite communication links use electromagnetic waves to propagate information
through the atmosphere and space. The information is converted from electrical signals
to radio signals by the transmitter and the antenna. Once these radio signals leave the
antenna, they travel approximately at the speed of light for free space.
Let’s calculate how long it will take an email to travel from Hyderabad to New York
assuming that we are the only user on a private communications channel.
Ignoring the actual routes taken by undersea cables due to the ocean’s floor, let’s
assume the path from Hyderabad to New York is the great circle distance of 5458 km.
( ℎ ℎ )
=

The email sent using a copper link: = 23.58 ms


.

The email sent using a fiber-optic link: = 26.01 ms


.

The email sent using a radio link: = 18.21 ms


.

These are the latencies caused only by propagation delays in the transmission medium.
If you were the only one sending one single data bit and you had unlimited bandwidth
available, the speed of the packet would still be delayed by the propagation delay.
This delay happens without regard for the amount of data being transmitted, the
transmission rate, the protocol being used or any link impairment.

[Link] Serialization Delay [Transmission Delay]


Serialization is the conversion of bytes (8 bits) of data stored in a computer’s memory
into a serial bit stream to be transmitted over the communications media. Serialization
delay is also called or . Serialization takes a finite amount of
time and is calculated as follows:

For example:

2.11 Network Performance 37


Elements of Computer Networking Introduction

 Serialization of a 1500 byte packet used on a 56K modem link will take 214
milliseconds
 Serialization of the same 1500 byte packet on a 100 Mbps LAN will take 120
microseconds
Serialization can represent a significant delay on links that operate a lower
transmission rates, but for most links this delay is a tiny fraction of the overall latency
when compared to the other contributors.
Voice and video data streams generally use small packet sizes (~20 ms of data) to
minimize the impact of serialization delay.

[Link] Processing Delay


In IP networks such as the Internet, IP packets are forwarded from source to
destination through a series of IP routers or switches that continuously update their
decision about which next router is the best one to get the packet to its destination. A
router or circuit outage or congestion on a link along the path can change the routing
path which in turn can affect the latency.
High performance IP routers and switches add approximately 200 microseconds of
latency to the link due to . If we assume that the average IP backbone
router spacing is 800 km, the 200 microseconds of routing/switching delay is
equivalent to the amount of latency induced by 40km of fiber; routing/switching latency
contributes to only 5% of the end to end delay for the average internet link.

[Link] Queuing and Buffer Management


Another issue which occurs within the transport layers is called . This
refers to the amount of time an IP packet spends sitting in a queue awaiting
transmission due to over-utilization of the outgoing link after the routing/switching
delay has been accounted for. This can add up to an additional 20 ms of latency.

2.11.3 Transmission Rate and Bandwidth


is a term used to describe the number of bits which can be extracted
from the medium. Transmission rate is commonly measured as the number of bits
measured over a period of one second.
The describes the fundamental limitation of a network
medium: If the medium is a copper Local Area Network, maximum transmission rates
are commonly 10, 100, or 1000 Megabits per second. These rates are primarily limited
by the properties of the copper wires and the capabilities of the network interface card
are also a factor.
Fiber-optic the transmission rates range from around 50 Mbps up to 100 Gbps. Unlike
copper networks, the primary factor limiting fiber-optic transmission rates is the
electronics which operates at each end of the fiber. Wireless local area networks (LANs)
and satellite links use modems (modulator/demodulator) to convert digital bits into an
analog modulated waveform at the transmitter end of a link, and then at the receive end
a demodulator will then convert the analog signal back into digital bits.
The limiting factor in transmitting information over radio-based channels is the
bandwidth of the channel that is available to a particular signal and the noise that is
present that will corrupt the signal waveform.

[Link] Radio Channel Bandwidth and Noise


Signals transmitted using radio waves occupy radio spectrum. Radio spectrum is not an
unlimited resource and must be shared. To prevent radio interference between users

2.11 Network Performance 38


Elements of Computer Networking Introduction

the use of radio spectrum is controlled by nearly every government on the planet. The
amount of radio spectrum occupied by any given radio signal is called its bandwidth.
The nature of radio spectrum use is beyond this paper but it’s important to understand
that generally the occupied radio spectrum of a modem signal will increase with the
data rate:
 Higher modem data rates cause the modem to occupy more radio bandwidth
 Lower modem data rates will let the modem occupy less radio bandwidth
Since radio spectrum is a limited resource, the occupied radio bandwidth is an
important limiting factor in wireless and satellite links.
Noise in the radio channel will perturb the analog signal waveform and can cause the
demodulator at the receiver to change a digital one into a zero or vice versus. The effect
of noise can be overcome by increasing the power level of the transmitted signal, or by
adding a few extra error correcting bits to the data that is being transmitted. These
error correcting bits help the receiver correct bit errors. However, the error correction
bits increase the bandwidth that is required.

[Link] Data Bandwidth


In data transmission, the ℎ is synonymous to the transmission rate being
used. Bandwidth is important because it defines the maximum capacity of a data link.
 A 10 Mbps copper LAN cannot sustain traffic flowing at a higher rate than 10
megabits every second.
 A satellite link using modems operating at a 600 Mbps rate cannot flow any
more than 600 megabits every second.
It’s very important to understand that data bandwidth is a maximum data flow
obtainable over a given transportation segment over a given period of time.

2.11.4 Bandwidth × Delay Product


In data communications, bandwidth-delay product refers to the product of a data link's
capacity (in bits per second) and its end-to-end delay (in seconds). The result, an
amount of data measured in bits (or bytes), is equivalent to the maximum amount of
data on the network circuit at any given time, i.e., data that has been transmitted but
not yet acknowledged.
Delay or Latency

Bandwidth

The Bandwidth × Delay Product, or BDP for short determines the amount of data that
can be in transit in the network. It is the product of the availalbe bandwidth and the
latency. Sometimes it is calculated as the data link's capacity multiplied by its round
trip time (RTT). BDP is a very important concept in a Window based protocol such as
TCP.
It plays an especially important role in high-speed / high-latency networks, such as
most broadband internet connections. It is one of the most important factors of
tweaking TCP in order to tune systems to the type of network used.
The BDP simply states that:
( ) = ℎ( / ) × ( )
2.11.5 Revisiting Queuing Delay
2.11 Network Performance 39
Elements of Computer Networking Introduction

Queuing delay depends on the number and size of the other packets in the queue before
it as well as the transmission rate of the interface. With queuing delays, below is the
common question which arises frequently.
When is the queuing delay large and when is it insignificant?
The answer to this question depends on the rate at which traffic arrives at the queue,
the transmission rate of the link, and the nature of the arriving traffic, that is, whether
the traffic arrives occasionally or arrives in bursts. To get some insight here, let “ ”
denote the average rate at which packets arrive at the queue (" " is in units of
packets/sec). Also, assume that is the transmission rate; that is, it is the rate (in
bits/sec) at which bits are pushed out of the queue.
For simplicity, that all packets consist of bits. Then the average rate at which bits
arrive at the queue is bits/sec. Finally, suppose that the queue is very big, so that it
can hold basically an infinite number of bits. The ratio / , called the ,
often plays an important role in estimating the extent of the queuing delay.
×
=
Where, is the average arrival rate of packets (e.g. packets/sec)
is the average packet length (e.g. in bits), and
is the transmission rate (e.g. bits/sec)
If × / > 1, then the average rate at which bits arrive at the queue exceeds the rate
at which the bits can be transmitted from the queue. In this unfortunate situation, the
queue will tend to increase without bound and the queuing delay will approach infinity.
Therefore, one of the golden rules in traffic engineering is: Design your system so that
the traffic intensity is no greater than 1.
Now think about the case × / = 1. Here, the nature of the arriving traffic impacts
the queuing delay. For instance, if packets arrive periodically -that is, one packet
arrives every / seconds - then every packet will arrive at an empty queue and there
will be no queuing delay. On the other hand, if packets arrive in bursts but
occasionally, there can be a considerable average queuing delay.
For instance, suppose packets arrive simultaneously every ( / ) seconds. Then the
first packet transmitted has no queuing delay; the second packet transmitted has a
queuing delay of / seconds; and more commonly, the packet transmitted has a
queuing delay of ( − 1) × / seconds.

2.11.6 Throughput versus Bandwidth


Even though widely used in the field of networking, bandwidth and throughput are two
commonly misunderstood concepts. When planning and building new networks,
network administrators widely use these two concepts. Bandwidth is the maximum
amount of data that can be transferred through a network for a specified period of time
while throughput is the actual amount of data that can be transferred through a
network during a specified time period.
Bandwidth can be defined as the amount of information that can flow through a
network at a given period of time. Bandwidth actually gives the maximum amount of
data that can be transmitted through a channel in theory. When you say that you have
a 100 Mbps broadband line you are actually referring to the maximum amount of data
that can travel through your line per second, which is the bandwidth.
Even though the basic measurement for bandwidth is bits per second (bps), since it is a
relatively small measurement, we widely use kilobits per second (kbps), megabits bits
per second (Mbps), and gigabits per second (Gbps).

2.11 Network Performance 40


Elements of Computer Networking Introduction

Most of us know from experience that the actual network speed is much slower than
what is specified. Throughput is the actual amount of data that could be transferred
through the network. That is the actual amount of data that gets transmitted back and
forth from your computer, through the Internet to the web server in a single unit of
time.
When downloading a file you will see a window with a progress bar and a number. This
number is actually the throughput and you must have noticed that it is not constant
and almost always has a value lower than specified bandwidth for your connection.
Several factors like the number of users accessing the network, network topology,
physical media and hardware capabilities can effect this reduction in the bandwidth. As
you can imagine, throughput is also measured using the same units used to measure
the bandwidth.
As you have seen, bandwidth and throughput seems to give a similar measurement
about a network, at the first glance. They are also measured using the same units of
measurement. Despite all these similarities they are actually different. We can simply
say that the bandwidth is the maximum throughput you can ever achieve while the
actual speed that we experience while surfing is the throughput.
To simplify further, you can think of the bandwidth as the width of a highway. As we
increase the width of the highway more vehicles can move through a specified period of
time. But when we consider the road conditions (craters or construction work in the
highway) the number of vehicles that can actually pass through the specified period of
time could be less than the above. This is actually analogous to the throughput. So it is
clear that bandwidth and throughput gives two different measurements about a
network.

2.11.7 Important Notes


Consider the following definitions:
R Transmission rate (bits/second)
S Signal speed (meters/second)
D Distance between the sender and receiver (meters)
T Time to create (build) one frame (microseconds)
F Number of bits in a frame/packet
N Number of data bits in a frame/packet
A Number of bits in an acknowledgement
P Percentage of time that bit are in the channel
1. Since R is the transmission rate, the amount of time required to transmit one
bit is .
2. Since there are F bits in a frame, time required to transmit the whole frame is
.
3. The bits must then travel the channel. Since D is the length of the channel and
S is the speed of the signal, the time required to travel the channel is . So,
after the last bit is transmitted it requires time to get to the receiver.
4. Time required for a frame to be sent is: Time to create a frame + Time to
transmit a whole frame + Time required by the last bit to travel = + + .
5. Similarly the time required for an acknowledgement is + + .
6. In the unrestricted protocol a new frame is built as soon as the last one is sent.
So the time required to build a new frame is + .

2.11 Network Performance 41


Elements of Computer Networking Introduction

7. For stop-and-wait, time required to build a new frame is + + + + + .


8. The time required to transmit a frame is + .
9. Let P be the percentage of time that bits are in the channel. With the
unrestricted protocol we have: P = ×

With the stop and wait protocol we have: P = + ×

10. : It is defined as the number of data bits sent per unit time.
It is found by dividing the number of data bits by the elapsed time between
sending two frames. For the unrestricted protocols the effective data rate is
. For the stop and wait protocol, it is .

2.12 Network Switching


The purpose of a communication system is to exchange information between two or
more devices. Such system can be optimized for voice, data, or both.
Node Communication Link Node
or or
Station Station
Point-to-Point Network
In its simplest form, a communication system can be established between two nodes (or
stations ) that are directly connected by some form of - - transmission
medium. A station may be a PC, telephone, fax machine, mainframe, or any other
communicating device.
This may, however, be impractical, if there are many geographically dispersed nodes or
the communication requires dynamic connection between different nodes at various
times.

Link

Node

It is not efficient to build a physically separate path for each pair of communicating end
systems. An alternative method to a - - connection is ℎ a
network. In a communication network, each communicating (or
or or ℎ ) is connected to a network node.
The interconnected nodes are capable of transferring data between stations.

Shared Medium

Communication Network
Depending on the architecture and techniques used to transfer data, two basic
categories of communication networks are broadcast networks and switched networks.
 Broadcast Networks
2.12 Network Switching 42
Elements of Computer Networking Introduction

 Switched Networks
Communication Networks

Broadcast Networks Switched Networks

2.12.1 Broadcast Networks


In networks, a single node transmits the information to all other nodes and
hence, all stations will receive the data. A simple example of such network is a simple
radio system, in which all users tuned to the same channel can communicate with each
other. Other examples of broadcast networks are satellite networks and Ethernet-based
local area networks, where transmission by any station will propagates through the
network and all other stations will receive the information.

Node

Link

Broadcast is a method of sending a signal where multiple nodes may hear a single
sender node. As an example, consider a conference room with full of people. In this
conference room, a single person starts saying some information loudly.
During that time, some people may be sleeping, and may not hear what person is
saying. Some people may not be sleeping, but not paying attention (they are able to
hear the person, but choose to ignore). Another group of people may not only be awake,
but be interested in what is being said. This last group is not only able to hear the
person speaking, but is also listening to what is being said.
In this example, we can see that a single person is broadcasting a message to all others
that may or may not be able to hear it, and if they are able to hear it, may choose to
listen or not.

2.12.2 Switched Networks


A network is a series of connected devices. Whenever we have many devices, the
interconnection between them becomes more difficult as the number of devices
increases. Some of the conventional ways of interconnecting devices are
a. Point to point connection between devices as in ℎ topology.
b. Connection between a central device and every other device as in topology.
c. Bus topology is not practical if the devices are at greater distances.
The solution to this interconnectivity problem is ℎ . A switched network consists
of a series of interlinked nodes called ℎ . A switch is a device that creates
temporary connections between two or more systems. Some of the switches are
connected to end systems (computers and telephones) and others are used only for
routing.
In a switched network, the transmitted data is not passed on to the entire medium.
Instead, data are transferred from source to destination through a series of
nodes, called ℎ . Such nodes are only concerned about how to move the
data from one node to another until the data reaches its destination node.
Switched communication networks can be categorized into different types such as the
following.
2.12 Network Switching 43
Elements of Computer Networking Introduction

Communication Networks

Broadcast Networks Switched Networks

Circuit Switched Packet Switched Message Switched

Datagram Switched Virtual Circuit Switched


Switched

[Link] Circuit Switched Networks


The term circuit switching refers to a communication mechanism that establishes a
path between a sender and receiver with guaranteed isolation from paths used by other
pairs of senders and receivers. Circuit switching is usually associated with telephone
technology because a telephone system provides a dedicated connection between two
telephones. In fact, the term originated with early dialup telephone networks that used
electromechanical switching devices to form a physical circuit.
In a circuit-switched network, also called - ℎ network, a dedicated physical
communication path is established between two stations through the switching nodes
in the network. Hence, the end-to-end path from source to destination is a connected
sequence of physical links between nodes and at each switching node the incoming data
is switched to the appropriate outgoing link.

Circuit Establishment

Data Transfer

Circuit Disconnect

A circuit-switched communication system involves ℎ phases: circuit establishment


(setting up dedicated links between the source and destination);
(transmitting the data between the source and destination); and
(removing the dedicated links). In circuit switching the connection path is established
before data transmission begins ( - ).

Therefore, the channel capacity must be reserved between the source and destination
throughout the network and each node must have available internal switching capacity
to handle the requested connection. Clearly, the switching nodes must have the
intelligence to make proper allocations and to establish a route through the network.

2.12 Network Switching 44


Elements of Computer Networking Introduction

The most common example of a circuit-switched network can be found in public


telephone network supporting services such as POTS (plain old telephone systems) and
long-distance calls.

[Link] Packet Switched Networks


The main alternative to circuit switching is packet switching which forms the basis for
the Internet. A packet switching system uses statistical multiplexing in which
communication from multiple sources competes for the use of shared media.
The main difference between packet switching and other forms of statistical
multiplexing arises because a packet switching system requires a sender to divide each
message into blocks of data that are known as packets. The size of a packet varies; each
packet switching technology defines a maximum packet size.

Three general properties define a packet switched paradigm:


1. Arbitrary, asynchronous communication
2. No set-up required before communication begins
3. Performance varies due to statistical multiplexing among packets
The first property means that packet switching can allow a sender to communicate with
one recipient or multiple recipients, and a given recipient can receive messages from
one sender or multiple senders. Furthermore, communication can occur at any time,
and a sender can delay arbitrarily long between successive communications.
The second property means that, unlike a circuit switched system, a packet switched
system remains ready to deliver a packet to any destination at any time. Thus, a sender
does not need to perform initialization before communicating, and does not need to
notify the underlying system when communication terminates.
The third property means that multiplexing occurs among packets rather than among
bits or bytes. That is, once a sender gains access to the underlying channel, the sender
transmits an entire packet, and then allows other senders to transmit a packet. When
no other senders are ready to transmit a packet, a single sender can transmit
repeatedly.
However, if senders each have a packet to send, a given sender will transmit
approximately of all packets.

In packet switching, packets can be handled in two ways:


1. Datagram
2. Virtual Circuit

2.12 Network Switching 45


Elements of Computer Networking Introduction

[Link].1 Datagram Packet Switching


Datagram packet-switching is a switching technology. Each packet is routed
independently through the network. Each packet can take any practical route to the
desired destination. Therefore packets contain a header with the full information about
the destination. The intermediate nodes examine the header of a packet and select an
appropriate link to another node which is nearer to the destination. In this system, the
packets do not follow a pre-established route, and the intermediate nodes do not
require prior knowledge of the routes that will be used.
The packets may arrive out of order and they may go missing. The receiver will take
care of re-ordering the packets and recover from missing packets.
In this technique, there is no need for setting up a connection. We just need to make
sure each packet contains enough information to get it to destination. To give
importance to critical packets, priorities can be attached to each packet.
The individual packets which form a data stream may follow different paths between the
source and the destination. As a result, the packets may arrive at the destination out of
order. When this occurs, the packets will have to be reassembled to form the original
message. Because each packet is switched independently, there is no need for
connection setup and no need to dedicate bandwidth in the form of a circuit.
Datagram packet switches use a variety of techniques to forward traffic; they are
differentiated by how long it takes the packet to pass through the switch and their
ability to filter out corrupted packets.
The most common datagram network is the Internet, which uses the IP network
protocol. Applications which do not require more than a best effort service can be
supported by direct use of packets in a datagram network, using the User Datagram
Protocol (UDP) transport protocol. Applications like voice and video communications
and notifying messages to alert a user that she/he has received new email are using
UDP. Applications like e-mail, web browsing and file upload and download need reliable
communications, such as guaranteed delivery, error control and sequence control. This
reliability ensures that all the data is received in the correct order without errors. It is
provided by a protocol such as the Transmission Control Protocol (TCP) or the File
Transfer Protocol (FTP).
To forward the packets, each switch creates a table (maps destinations to output port).
When a packet with a destination address in the table arrives, it pushes it out on the
appropriate output port. When a packet with a destination address not in the table
arrives, it will find the optimal route based on routing algorithms.

[Link].2 Virtual Circuit Packet Switching


Virtual circuit switching is a packet switching methodology whereby a path is
established between the source and the final destination through which all the packets
will be routed during a call. This path is called a virtual circuit because to the user, the
connection appears to be a dedicated physical circuit. However, other communications
may also be sharing the parts of the same path.
The idea of virtual circuit switching is to combine the advantages of circuit switching
with the advantages of datagram switching. In virtual circuit packet switching, after a
small connection setup phase only short (compared to full addresses) connection
identifier are used per packet; this reduces the addressing overhead per packet.
Before the data transfer begins, the source and destination identify a suitable path for
the virtual circuit. All intermediate nodes between the two points put an entry of the
routing in their routing table for the call. Additional parameters, such as the maximum

2.12 Network Switching 46


Elements of Computer Networking Introduction

packet size, are also exchanged between the source and the destination during call
setup. The virtual circuit is cleared after the data transfer is completed.
Virtual circuit packet switching is connection orientated. This is in contrast to
datagram switching, which is a connection less packet switching methodology.

[Link].2.1 Advantages of Virtual Circuit Switching


Advantages of virtual circuit switching are:
 Packets are delivered in order, since they all take the same route;
 The overhead in the packets is smaller, since there is no need for each packet
to contain the full address;
 The connection is more reliable, network resources are allocated at call setup so
that even during times of congestion, provided that a call has been setup, the
subsequent packets should get through;
 Billing is easier, since billing records need only be generated per call and not
per packet.

[Link].2.2 Disadvantages of Virtual Circuit Switching


Disadvantages of a virtual circuit switched network are:
 The switching equipment needs to be more powerful, since each switch needs to
store details of all the calls that are passing through it and to allocate capacity
for any traffic that each call could generate;
 Resilience to the loss of a trunk is more difficult, since if there is a failure all
the calls must be dynamically re-established over a different route.

[Link] Message Switched Networks


Prior to advances in packet switching, message switching was introduced as an effective
alternative to circuit switching. In message switching, end-users communicate by
sending each other a message, which contains the entire data being delivered from the
source to destination node.
As a message is routed from its source to its destination, each intermediate switch
within the network stores the entire message, providing a very reliable service. In fact,
when congestion occurs or all network resources are occupied, rather than discarding
the traffic, the message-switched network will store and delay the traffic until sufficient
resources are available for successful delivery of the message.
The message storing capability can also lead to reducing the cost of transmission; for
example, messages can be delivered at night when transmission costs are typically
lower.
Message switching techniques were originally used in data communications. Early
examples of message switching applications are Electronic mail (E-mail) and voice mail.
Today, message switching is used in many networks, including adhoc sensor networks,
satellite communications networks, and military networks.
Message-switched data networks are hop-by-hop systems that support two distinct
characteristics: - - and .
In a message-switched network, there is no direct connection between the source and
destination nodes. In such networks, the intermediary nodes (switches) have the
responsibility of conveying the received message from one node to another in the
network. Therefore, each intermediary node within the network must store all messages
before retransmitting them one at a time as proper resources become available. This
characteristic is called - - . In message switching systems (also called
- - systems), the responsibility of the message delivery is on the next
2.12 Network Switching 47
Elements of Computer Networking Introduction

hop, as the message travels through the path toward its destination. Hence, to ensure
proper delivery, each intermediate switch may maintain a copy of the message until its
delivery to the next hop is guaranteed.
In case of message broadcasting, multiple copies may be stored for each individual
destination node. The store-and-forward property of message-switched networks is
different from queuing , in which messages are simply stored until their preceding
messages are processed. With store-and-forward capability, a message will only be
delivered if the next hop and the link connecting to it are both available. Otherwise, the
message is stored indefinitely. For example, consider a mail server that is disconnected
from the network and cannot receive the messages directed to it. In this case, the
intermediary server must store all messages until the mail server is connected and
receives the e-mails.
The store-and-forward technology is also different from admission control techniques
implemented in packet-switched or circuit switched networks. Using admission control,
the data transmission can temporarily be delayed to avoid overprovisioning the
resources. Hence, a message-switched network can also implement an admission
control mechanism to reduce network’s peak load.
The message delivery in message-switched networks includes wrapping the entire
information in a single message and transferring it from the source to the destination
node. The message size has no upper bound; although some messages can be as small
as a simple database query, others can be very large. For example, messages obtained
from a meteorological database center can contain several million bytes of binary data.
Practical limitations in storage devices and switches, however, can enforce limits on
message length.
Each message must be delivered with a header. The header often contains the message
routing information, including the source and destination, priority level, expiration
time. It is worth mentioning that while a message is being stored at the source or any
other intermediary node in the network, it can be bundled or aggregated with other
messages going to the next node. This is called . One important
advantage of message interleaving is that it can reduce the amount of overhead
generated in the network, resulting in higher link utilization.

Problems and Questions with Answers


Question 1: Suppose that a computer that is used as a switch can process 30,000
packets/second. Give a range of possible bit rates that traverse the I/O bus and
main memory.
: The 30,000 packets/second processing speed means 30,000 packets are going
in and 30,000 packets are coming out of the switch every second. Therefore the I/O bus
speed is 60,000 packets/second.

Minimum IP packet size = 64 bytes Bit rate = 60,000×64×8 = 30.78 Mbps


Average IP packet size = 500 bytes Bit rate = 60,000×500×8 = 240 Mbps
Maximum Ethernet frame size =1500 bytes Bit rate = 60,000×1500×8 = 720 Mbps

Question 2: Imagine the length of a cable is 2500 metres. If the speed of propagation in
a thick co-axial cable is 60% of the speed of light, how long does it take for a bit to
travel from the beginning to the end of the cable? Ignore any propagation delay in
the equipment. (Speed of light = 3 x 10 metres / sec)
: Speed of propagation = 60% × = 60 × 3 × 10 / 100 = 18 × 10 metres / sec.
So it would take a bit 2500 / 18 × 10 = 13.9 secs.
Question 3: Suppose that data are stored on 2.44 Mbyte floppy diskettes that weight
20 gm each. Suppose that an airliner carries 10 kg of these floppies at a speed of
2.12 Network Switching 48
Elements of Computer Networking Introduction

2000 km/h over a distance of 8000 km. What is the data transmission rate in bits
per second of this system?
: Let us first calculate the time for which data was carried.
=
So, Time = = = 4 hrs.

Now 2.44 Mbytes = 2.44 × 10 × 8 bits = 19.52 × 10 bits.


Each floppy weighs 20 gm, and total load (of floppies) carried is 10 kg = 10 gms.
Hence, number of floppies carried = 10 gms / 20 gms = 500000.
Now each floppy contains 19.52 × 10 bits and so 500000 floppies will contain
19.52 × 10 × 500000 bits = 9760000 × 10 bits.
Now calculate data transmission speed:
Transmission speed ×
= =
( )
= 542.2 × 10 bits/sec= 542.2 Mbps.
Question 4: A simple telephone system consists of two end offices and a single toll
office to which each end office is connected by a 1-MHz full-duplex trunk. The
average telephone is used to make four calls per 8-hour workday. The mean call
duration is 6 min. Ten percent of the calls are long-distance (i.e., pass through the
toll office). What is the maximum number of telephones an end office can support?
Assume 4 kHz per circuit.
: Each telephone makes 0.5 calls/hour at 6 minutes each. Thus, a telephone
occupies a circuit for 3 min/hour. Twenty telephones can share a circuit. Since 10% of
the calls are long distance, it takes 200 telephones to occupy a long-distance circuit full
time. The interoffice trunk has =250 circuits multiplexed onto it. With 200
telephones per circuit, an end-office can support 200×250 = 50,000 telephones.
Question 5: A channel has a bit rate of 4 kbps and a propagation delay of 20 msec. For
what range of frame sizes does stop-and-wait give an efficiency of at least 50%?
: Efficiency will be 50% when the time to transmit the frame equals the round
trip propagation delay. At a transmission rate of 4 bits/ms, 160 bits takes 40 ms. For
frame sizes above 160 bits, stop-and-wait is reasonably efficient.
Question 6: Suppose a 128 kbps peer-to-peer link is set up between earth and a rover
on mars. The distance from the earth to mars (when they are the closest together) is
approximately 55 Gm (Gigameter), and data travels over the link at the speed of
light 3 × 10 meters/sec. Calculate the minimum RTT for the link.
×
: Propagation delay of the link is = 184 secs. Thus, RTT = 368 secs.
×
Question 7: For the Question 6, calculate the ℎ product of the link.
Answer: The delay × bandwidth product for the link is the RTT × bandwidth = 23.5 Mb.
Question 8: For the Question 6, a camera on the rover takes pictures of its
surroundings and sends these to the earth. How quickly can it reach Mission
Control on Earth? Assume that each image is 5 Mb in size.
: After a picture is taken, it must be transmitted on the link and completely
propagated, before Mission Control can interpret it. Transmit delay for 5 Mb of data is
29 secs. Hence, total time = Transmit delay + Propagation delay = 223 secs.
Question 9: Calculate the latency (from first bit sent to the last bit received) for the
following: 1 Gbps Ethernet with a single store and forward switch in the path, and a
packet size of 5000 bits. Assume that each link introduces a propagation delay of

2.12 Network Switching 49


Elements of Computer Networking Introduction

10 µ (micro second) and that the switch begins retransmitting immediately after it
has finished receiving the packet.
:
A) For each link it takes = 5 µ to transmit the packet on the link, after which it
takes an additional 10 µs for the last bit to propagate across the link. Thus for a LAN
with only with only one switch that starts forwarding only after receiving the whole
packet, the total transfer delay is the transmit delays + two propagation delays = 30 µ .
B) For 3 switched and thus 4 links, the total delay is 4 transmission delays + 4
propagation delays = 60 µ .
Question 10: Determine the maximum length of the cable (in km) for transmitting data
at a rate of 500 Mbps in an Ethernet LAN with frames of size 10,000 bits. Assume
the signal speed in the cable to be 2,00,000 km/s.
A) 1 B) 2 C) 2.5 D) 5
:B
= +
ℎ ℎ
= +
Propagation time
2× ℎ
=
Propagation time
10000 2× ℎ
=
500 × 1000000 bits/sec 200000 /
Length = 2 km
Question 11: A packet switch receives a packet and determines the outbound link to
which the packet should be forwarded. When the packet arrives, one other packet is
halfway done being transmitted on this outbound link and four other packets are
waiting to be transmitted. Packets are transmitted in order of arrival. Suppose all
packets are 1,200 bytes and the link rate is 3 Mbps. What is the queuing delay for
the packet? More generally, what is the queuing delay when all packets have length
S, the transmission rate is T, X bits of the currently being transmitted packet have
been transmitted, and packets are already in the queue?
: The arriving packet must first wait for the link to transmit 5,400 bytes or
43,200 bits. Since these bits are transmitted at 3 Mbps, the queuing delay is 14.3 msec.
× ( )
Generally, the queuing delay is .

Question 12: Suppose we would like to urgently deliver 60 Terabytes of data from
to . We have a 1000 Mbps dedicated link for data transfer
available. Would you prefer to transmit the data via this link or instead use AirMail
overnight delivery? Explain.
Answer: 60 Terabytes = 60 × 10 × 8 bits. So, if using the dedicated link, it will take 60
× 10 × 8 / (1000 × 10 ) = 480000 seconds = 5.6 days. But with AirMail overnight
delivery, we can guarantee the data arrives in one day, and it only costs us no more
than USD 100.
Question 13: Two nodes, A and B, communicate through a store & forward network.
Node A is connected to the network by a 10 Mbps link, while node B is connected
by a 5 Mbps link. Node A sends two back-to-back packets of 1000 bits each. The
difference between the arrival times of the two packets at B is 1 ms. What is the
smallest capacity of a link along the path between A and B?
Note: Assume that there are no other packets in the network except the ones sent
by A, and ignore the packet processing time. Assume both packets follow the same

2.12 Network Switching 50


Elements of Computer Networking Introduction

path, and they are not reordered. The arrival time of a packet at a node is defined
as the time when the last bit of the packet has arrived at that node.
: Since packets are sent back-to-back, the difference between the arrival times of
the packets at B represents the transmission time of the second packet on the slowest
link in the path. Thus, the capacity of the slowest link is 1000 bits/1 ms = 1 Mbps.
Question 14: Consider an infinite queue that can send data at 10 Kbps. Assume the
following arrival traffic:
• During every odd second the queue receives an 1000 bit packet every 50 ms
• During every even second the queue receives no data.
Assume an interval I of 10 sec starting with an odd second (i.e., a second in which
the queue receives data). At the beginning of interval I the queue is empty. What is
the maximum queue size during interval I?
: 10 packets. There are 20 packets arriving during the 1 second and 10 packets
sent at the end of that second. Thus at the end of 1 second there are 10 packets in the
queue. All the 10 packets will be sent at the end of 2 second (since no new packets are
received). Thus, at the end of 2 second the queue size is 0. After that the process
repeats.
(Note: The following alternate answers: 11 packets, 10 Kb, and 11 Kb all received
maximum points. The 11 packets and 11 Kbps assume that at a time when a packet is
received and another one is sent out, the received packet is already in the queue as the
other packet is sent out.)
Question 15: For the Question 14, what is the average time (delay) a packet spends in
the queue during interval I?
:
• 1 packet arrives at time 0 and starts being transmitted immediately, at time 0. →
delay 0
• 2 packet arrives at 0.05 s and starts being transmitted at 0.1 s (after the first
packet) → delay 0.05 s
• 3 packet arrives at 0.1 s and starts being transmitted at 0.2 s (after first two
packets) → delay 0.1 s
• 4 packet arrives at 0.15 s and starts being transmitted at 0.3 s (after first three
packets) → delay 0.15 s

• packet arrives at ( − 1)×0.05 s and starts being transmitted at (k-1)*0.1 s
delay ( − 1)×0.05 s
This process continues every 2 seconds.
Thus, the average delay of the first 20 packets is
( … )× . × × .
= = 0.475 s

Alternate solution that approximates the average delay: We use Little’s theorem:
_ _ _
_ = . During an odd second the number of packets in the
_
queue increases linearly from 0 to 10 and during the next second it decreases from 10
to 0. This means that the average number of packets in the queue is 5. Over an odd and
an even second the average arrival rate is = 10.
_ _ _
Then, _ = = = 0.5sec.
_

(Note: The following answers also received maximum points: 0.575s and 0.5s.)

2.12 Network Switching 51


Elements of Computer Networking Introduction

Question 16: Similar to Question 14 and Question 15, now assume that during odd
seconds the queue receives 1000 bit packets every 25 ms (instead of every 50 ms),
and during even seconds it still receives no data. For this traffic patterns answer
the same questions. What is the maximum queue size during interval I?
: 110 packets. In this case the queue is never empty. During the first 9 seconds
of interval I there are 5 s×(1 s/25 ms) = 200 packets received and 90 packets sent out.
Thus, at the end of the 9 second there are 110 packets in the queue.
(Note: The following answers also received the maximum number of points: 111
packets, 110 Kb, and 111 Kb.)
Question 17: For the Question 16, what is the average time (delay) a packet spends in
the queue during interval I?
: Packets received during first second
• 1 packet arrives at time 0 and starts being transmitted immediately, at time 0. →
delay 0
• 2 packet arrives at 0.025 s and starts being transmitted at 0.1 s (after the first
packet) → delay 0.075 s
• 3 packet arrives at 0.05s and starts being transmitted at 0.2 s (after first two
packets) → delay 0.15 s
• 4 packet arrives at 0.075 s and starts being transmitted at 0.3 s (after first three
packets) → delay 0.225 s

• packet arrives at ( − 1)×0.025 s and starts being transmitted at ( − 1)×0.1 s →
delay ( − 1) ×0.075s
The average delay of the packets in the first two seconds is
( … )∗ . × × .
= = 1.4625 s

Packets received during 3 second: note that at the beginning of the 3 second there
are still 20 packets in the queue
• 1 packet arrives at time 0 and starts being transmitted immediately, at time 2s →
delay 2
• 2 packet arrives at 0.025s and starts being transmitted at 2+0.1 s → delay
2+0.075 s
• 3 packet arrives at 0.05s and starts being transmitted at 2+0.2 s → delay 2+0.15
s
• 4 packet arrives at 0.075s and starts being transmitted at 2+0.3 s → delay
2+0.225 s

• packet arrives at (k-1)*0.025s and starts being transmitted at 2+( − 1) × 0.1 s
→ delay 2+( − 1) ×0.075 s
The average delay of the packets in the first two seconds is

( … )× . × × .
= = 3.4625 s

Packets received during 9 second: note that at the beginning of the 9 second there
are still 80 packets in the queue
• 1 packet arrives at time 0 and starts being transmitted immediately, at time 8s
→ delay 2
• 2 packet arrives at 0.025s and starts being transmitted at 8+0.1s → delay
8+0.075s

2.12 Network Switching 52


Elements of Computer Networking Introduction

• 3 packet arrives at 0.05s and starts being transmitted at 8+0.2s → delay


8+0.15s
• 4 packet arrives at 0.075s and starts being transmitted at 8+0.3s → delay
8+0.225s

• packet arrives at (k-1) × 0.025s and starts being transmitted at 8+(k-1) ×
0.1s → delay 8+(k-1) × 0.075s
The average delay of the packets in the first two seconds is
( … )× . × × .
= = 9.4625 s
. . . . .
Thus, the average delay over 10 seconds is: = 5.4625

Alternate solution that approximates the average delay: The average arrival rate is 40
packets/2 sec = 20 packets/sec.
During the 1st sec the number of packets in the queue increases linearly from 0 to 30,
thus the average number of packets in the queue in the 1 sec is 15. During 2 second
the queue decreases linearly from 30 to 20, thus the average number of packets in the
queue is 25, and the average number of packets in the queue over the first two seconds
is 20.
During 3 and 4 seconds the process repeats with the difference that there are 20
packets in the queue at the beginning of the 3 second. Thus, the average number of
packets in the queue during the 3 and 4 seconds is 20+20 = 40.
Similarly, the average number of packets during the 5 and 6 seconds is 40+20 = 60,
during the 7 and 8 seconds 60+20=80, and during the 9 and 10 seconds is
80+20=100.

Thus the average number of packets over the entire interval I is = 60.
_ _ _
According to the Little’s theorem _ = = = 6sec.
_
(Note: In general the average number of packets over the interval defined by the 2× − 1
and 2× seconds is ×20, where >= 1.)
Question 18: Suppose a CSMA/CD network is operating at 1 Gbps, and suppose there
are no repeaters and the length of the cable is 1 km. Determine the minimum frame
size if the signal propagation speed is 200 km/ms.
: Since the length of the cable is 1 km, we have a one-way propagation time of
= = 0.005 ms = 5 µs. So, 2 = 10 µs.
/

If we have 1 Gbps, we can calculate the amount of bits transmitted in 10 µs.

Let L be the minimum frame size, then 10 µs = = .


µ
This gives the value of L. L = 10,000 bits.
So the minimum frame size should be 10,000 bits.
Question 19: A signal has a fundamental frequency of 1000 Hz. What is its period?

: Period = = 1 ms.

Question 20: A digital signaling system is required to operate at 9600 bps. If a symbol
encodes a 4-bit word, what is the minimum required channel bandwidth?
: The formula to use is
Maximum number of bits/sec=2×Channel bandwidth×Number of bits per sample

2.12 Network Switching 53


Elements of Computer Networking Introduction

If number of different possible values of a sample is given, use the formula

Maximum number of bits/sec=2×Channel bandwidth×

Note that gives us the number of bits needed to represent


them or the number of bits/sample.
Based on above formula, 9600 = 2×h×4 or h = 1200 Hz.
Question 21: For the Question 20, what is the minimum bandwidth for 8-bit words?
: 9600 = 2×h×8 or h = 600 Hz.
Question 22: A channel, whose bandwidth is 3 MHz, has an intended capacity of 20
Mbps, Assuming white thermal noise, what signal to noise ratio is required to
achieve this capacity?
: Use the formula:

Maximum number of bits/sec = H×

Substitute H = 3 × 10 and maximum no of bits/sec to 20× 10 to get a of 100.6.

Question 23: Suppose that data is stored on 1.4 Mbyte floppy diskettes that weight 30
grams each. Suppose that an airliner carries 10 Kg of these floppies at a speed of
1000 Km/h over a distance of 5000 Km. What is the data transmission rate in bps
of this system?
: Each floppy measures 30 grams. We have the following
Number of floppies = 10 × 10 /30 = 333333.33
Total number of bits transported = Number of floppies × 1.4 × 1024 (not 1000!) × 1024 ×
8
i.e., Number of bits/sec = Total number of bits transported/5*3600.
The answer is 217.4 Mbps.
: When we talk of computer momory, it is typically measured in powers of 2, thefore
1 Kb = 2 bytes. When it comes to networks, we use clocks to send data, if a clock is 1
Khz, we transmit at the rate of 1 kilobits per sec, where the kilo is 1000, we are
transmitting at the clock rate.
Question 24: Consider a 150 Mb/s link that is 800 km long, with a queue large enough
to hold 5,000 packets. Assume that packets arrive at the queue with an average
rate of 40,000 packets per second and that the average packet length is 3,000 bits.
Approximately, what is the propagation delay for the link?
: 800 km times 5 microseconds per km is 4,000 microseconds or 4 ms.
Question 25: For the Question 24:, what is the transmission time for an average length
packet?
: Link speed is 150 bits per microsecond, so a 3,000 bit packet can be sent in 20
microseconds.
Question 26: For the Question 24:, what is the traffic intensity?
: Bit arrival rate is 40,000 times 3,000 or 120 Mb/s. Since the link rate is 150
Mb/s, I=0.8
Question 27: For the Question 24:, what is the average number of packets in the queue?

: =4.

2.12 Network Switching 54


Elements of Computer Networking Introduction

Question 28: What is the average number in the queue, if the average arrival rate is
80,000 packets per second?
: In this case, the traffic intensity is 1.6, so the queue will be nearly full all the
time. So, the average number is just under 5,000 packets.
Question 29: A user in Hyderabad, connected to the Internet via a 5 Mb/s connection
retrieves a 50 KB (B=bytes) web page from a web server in New York, where the
page references 4 images of 300 KB each. Assume that the one way propagation
delay is 20 ms. Approximately how long does it take for the page (including images)
to appear on the user’s screen, assuming persistent HTTP?
: Total time is 3RTT + Transmission time.
.
3RTT = 120 ms and Transmission time = = = 2 seconds
/ /
Total time = 2.12 seconds.
Question 30: For the Question 29, how long would it take using non-persistent HTTP
(assume a single connection)?
2(1 + number of objects in page)RTT + Transmission time
400 ms + 2 seconds = 2.4 seconds
Question 31: Suppose a movie studio wants to distribute a new movie as a digital file to
1,000 movie theaters across country using peer-to-peer file distribution. Assume
that the studio and all the theaters have DSL connections with an 8 Mb/s
downstream rate and a 4 Mb/s upstream rate and that the file is 10 GB long.
Approximately, how much time is needed to distribute the file to all the theaters
under ideal conditions?
: The total upstream bandwidth is about 4 Gb/s. Since the file must be delivered
to 1,000 studios, we have 10 TB of data to be delivered. At 4 Gb/s, this takes 20,000
seconds, or roughly 6 hours.
Question 32: For the Question 24:, suppose the studio wanted to use the client-server
method instead. What is the smallest link rate that is required at the studio that
will allow the file to be distributed in under 40,000 seconds?
: This time period is twice the time used for the first part, so the server’s
upstream bandwidth must be half as large as the upstream bandwidth of the peers in
the first part. So, 2 Gb/s is enough.
Question 33: Suppose a file of 5,000 bytes is to be sent over a line at 2400 bps.
Calculate the overhead in bits and time in using asynchronous communication.
Assume one start bit and a stop element of length one bit, and 8 bits to send the
byte itself for each character. The 8-bit character consists of all data bits, with no
parity bit.
: Each character has 25% overhead. For 10,000 characters, there are 20,000
extra bits. This would take an extra = 2.0833 seconds.

Question 34: Calculate the overhead in bits and time using synchronous
communication. Assume that the data are sent in frames. Each frame consists of
1000 characters - 8000 bits and an overhead of 48 control bits per frame.
: The file takes 10 frames or 480 additional bits. The transmission time for the
additional bits is = 0.2 seconds.

Question 35: What would the answers to Question 28 and Question 29 be for a file of
100,000 characters?
: Ten times as many extra bits and ten times as long for both.

2.12 Network Switching 55


Elements of Computer Networking Introduction

Question 36: What would the answers to Question 28 and Question 29 be for the
original file of 10,000 characters except at a data rate of 9600 bps?
: The number of overhead bits would be the same, and the time would be
decreased by a factor of 4 = .

Question 37: The loss of signal strength is called:


A) Attenuation B) Amplitude C) Noise D) Crosstalk
: Attenuation
Question 38: Large networks that encompass parts of states, multiple states, countries
and the world are called:
A) MANs B) LANs C) PANs D) WANs
:D
Question 39: The __of a signal is the number of times a signal makes a complete cycle
within a given time frame.
A) Bandwidth C) Frequency D) Amplitude D) Spectrum
:C
Question 40: In a ___ subnet, no unique dedicated physical path is established to
transmit the data packets across the subnet?
A) Circuit-switched B) Packet-switched C) Large D) Heavily loaded
:B
Question 41: A dial-up telephone system uses which type of subnet?
A) Circuit-switched B) Packet-switched C) Broadcast D) Logically switched
:A
Question 42: A 2 km long broadcast LAN has 10 bps bandwidth and uses CSMA/CD.
The signal travels along the wire at 2 × 10 m/s. What is the minimum packet size
that can be used on this network?
A) 50 bytes B) 100 bytes C) 200 bytes D) None of the above
: C.
Total distance for RTT = 4 Km
Transfer rate = 2 × 10 m/s
Time to transfer = ×
= 2 × 10 s
×
Data rate = 10 bps
Packet size = 2 × 10 s× 10 bps=200 bytes
Question 43: Station A uses 32 byte packets to transmit messages to Station B using a
sliding window protocol. The round trip delay between A and B is 80 milliseconds
and the bottleneck bandwidth on the path between A and B is 128 kbps. What is
the optimal window size that A should use ?
A) 20 B) 40 C) 160 D) 320
: B.
Path bandwidth = 128 kbps
Time delay = 80 ms
Total data = ×
80 × 128 × 10 × 10 bits = = 1280 bytes
1 packet size = 32 byte
Number of packets = 1280
= 40
32

2.12 Network Switching 56


Elements of Computer Networking OSI and TCP/IP Models

Chapter

OSI and TCP/IP


Models 3
3.1 Why OSI Model?
During the initial days of computer networks, they usually used proprietary solutions,
i.e., technologies manufactured one company were used in the computer networks.
And, that manufacturer was in-charge of all systems present on the network. There is
no option to use equipment’s from different vendors.
In order to help the interconnection of different networks, ISO (
) developed a reference model called OSI ( ) and
this allowed manufacturers to create protocols using this model. Some people get
confused with these two acronyms, as they use the same letters. ISO is the name of the
organization, while OSI is the name of the reference model for developing protocols.
ISO is the organization; OSI is the model.

3.2 What is a Protocol-Stack?


Before understanding what a protocol is, let us take an example. In some cultures
shaking head and means , in other cultures it means . If we don’t ensure
correct communication, we will soon have a war on our hands! Protocols are the rules
developed for communicating. In simple terms, a protocol is a standard set of rules and
regulations that allow two electronic devices to connect to and exchange information
with one another.
All of us are familiar with protocols for human communication. We have rules for
speaking, appearance, listening and understanding. These rules govern different layers
of communication. They help us in successful communication. Similarly, in computer
networks, a protocol is a set of rules that govern communications between the
computers.
A protocol stack is a complete of network protocol layers that work together to
provide capabilities. It is called a because it is typically designed as a
hierarchy of layers, each supporting the one above it and using those below it.
The number of layers can vary between models. For example, TCP/IP (transmission
control protocol/Internet protocol) has five layers (application, transport, network, data
link and physical) and the OSI (open systems interconnect) model has seven layers
(application, presentation, session, transport, network, data link and physical).
In order for two devices to communicate, they both must be using the same protocol
stack. Each protocol in a stack on one device must communicate with its equivalent

3.1 Why OSI Model? 57


Elements of Computer Networking OSI and TCP/IP Models

stack, or peer, on the other device. This allows computers running different operating
systems to communicate with each other easily.

3.3 OSI Model


The OSI model divides the problem of moving data between computers into seven
smaller tasks and they equate to the seven layers of the OSI reference model.
The OSI model deals with the following issues:
 How a device on a network sends its data, and how it knows when and where to
send it.
 How a device on a network receives its data, and how to know where to look for
it.
 How devices using different languages communicate with each other.
 How devices on a network are physically connected to each other.
 How protocols work with devices on a network to arrange data.
Network Processes to Applications
7 Application Provides network services to application processes (such as e-mail, file
transfer [FTP], and web browsing)
Data Representation
This layer ensures data is readable by receiving system; formats data;
6 Presentation
negotiates data transfer syntax for application layer. : ASCII,
EBCDIC, Encryption, GIF, JPEG, PICT, and mp3.
Interhost Communication
5 Session This layer establishes, manages, and terminates sessions between
applications. : NFS, SQL, and X Windows.
End-to-end connections
Deals with data transport issues between systems. It offers reliability,
4 Transport
establishes virtual circuits, detects/recovers from errors, and provides
flow control. : TCP and UDP.
Addresses and Best Path Determination
3 Network Provides connectivity and path selection between two end systems.
Routers live here. : IP, IPX, RIP, IGRP, and OSPF.
Access to Media
Provides reliable transfer of data across media. Responsible for
2 Data link
physical addressing, network topology, error notification, and flow
control. : NIC, Ethernet, and IEEE 802.3.
Binary Transmission
1 Physical Uses signaling to transmit bits (0s and 1s). : UTP, coaxial
cable, fiber optic cable, hubs, and repeaters.

3.3.1 The Application Layer


The top layer of the OSI model is the Application layer. The first thing that we need to
understand about the application layer is that it does not refer to the actual
applications that users run. Instead, it provides the framework that the actual
applications run on top of.
To understand what the application layer does, suppose for a moment that a user
wanted to use ℎ to open an FTP session and transfer a file. In this
particular case, the application layer would define the file transfer protocol. This
protocol is not directly accessible to the end user.
The end user must still use an application that is designed to interact with the file
transfer protocol. In this case, ℎ would be that application.

3.3 OSI Model 58


Elements of Computer Networking OSI and TCP/IP Models

3.3.2 The Presentation Layer


The presentation layer does some rather complex things, but everything that the
presentation layer does can be summed up in one sentence. The presentation layer
takes the data that is provided by the application layer, and converts it into a standard
format that the other below layers can understand.
Likewise, this layer converts the inbound data that is received from the session layer
into something that the application layer can understand.
The reason why this layer is necessary is because applications handle data differently
from one another. In order for network communications to function properly, the data
needs to be structured in a standard way.

3.3.3 The Session Layer


Once the data has been put into the correct format, the sending host must establish a
session with the receiving host. This is where the session layer comes into play. It is
responsible for establishing, maintaining, and eventually terminating the session with
the remote host.
The interesting thing about the session layer is that it is more closely related to the
application layer than it is to the physical layer. It is easy to think of connecting a
network session as being a hardware function, but in actuality, sessions are usually
established between applications.
If a user is running multiple applications, several of those applications may have
established sessions with remote resources at any time.

3.3.4 The Transport Layer


Transport layer is responsible for maintaining flow control. As you are no doubt aware,
the Windows operating system allows users to run multiple applications
simultaneously. It is therefore possible that multiple applications, and the operating
system itself, may need to communicate over the network simultaneously. The
Transport Layer takes the data from each application, and integrates it all into a single
stream.
This layer is also responsible for providing error checking and performing data recovery
when necessary. In essence, the Transport Layer is responsible for ensuring that all of
the data makes it from the sending host to the receiving host.

3.3.5 The Network Layer


The Network Layer is responsible for determining how the data will reach the recipient.
This layer handles things like addressing, routing, and logical protocols. Since this
series is geared toward beginners, I do not want to get too technical, but The Network
Layer creates logical paths, known as virtual circuits, between the source and
destination hosts. This circuit provides the individual packets with a way to reach their
destination. The Network Layer is also responsible for its own error handling, and for
packet sequencing and congestion control.
Packet sequencing is necessary because each protocol limits the maximum size of a
packet. The amount of data that must be transmitted often exceeds the maximum
packet size. Therefore, the data is fragmented into multiple packets. When this
happens, the Network Layer assigns each packet a sequence number.
When the data is received by the remote host, that device’s Network layer examines the
sequence numbers of the inbound packets, and uses the sequence number to
reassemble the data and to figure out if any packets are missing.

3.3 OSI Model 59


Elements of Computer Networking OSI and TCP/IP Models

If you are having trouble understanding this concept, then imagine that you need to
mail a large document to a friend, but do not have a big enough envelope. You could
put a few pages into several small envelopes, and then label the envelopes so that your
friend knows what order the pages go in. This is exactly the same thing that the
Network Layer does.

3.3.6 The Data Link Layer


The data link layer can be sub divided into two other layers; the Media Access Control
(MAC) layer, and the Logical Link Control (LLC) layer. The MAC layer basically
establishes the computer’s identity on the network, via its MAC address. A MAC
address is the address that is assigned to a network adapter at the hardware level. This
is the address that is ultimately used when sending and receiving packets. The LLC
layer controls frame synchronization and provides a degree of error checking.

3.3.7 The Physical Layer


The physical layer of the OSI model refers to the actual hardware specifications. The
Physical Layer defines characteristics such as timing and voltage. The physical layer
defines the hardware specifications used by network adapters and by the network
cables (assuming that the connection is not wireless). To put it simply, the physical
layer defines what it means to transmit and to receive data.

3.3.8 How OSI Model Works? [Communications between Stacks]


The OSI reference model is actually used to describe how data that is generated by a
user, such as an email message, moves through a number of intermediary forms until it
is converted into a stream of data that can actually be placed on the network media and
sent out over the network. The model also describes how a communication session is
established between two devices, such as two computers, on the network.

Since other types of devices, such as printers and routers, can be involved in network
communication, devices (including computers) on the network are actually referred to
as . Therefore, a client computer on the network or a server on the network would
each be to as a .

While sending data over a network, it moves down through the OSI stack and is
transmitted over the transmission media. When the data is received by a node, such as
another computer on the network, it moves up through the OSI stack until it is again in
a form that can be accessed by a user on that computer.

Each of the layers in the OSI model is responsible for certain aspects of getting user
data into a format that can be transmitted on the network. Some layers are for
establishing and maintaining the connection between the communicating nodes, and
other layers are responsible for the addressing of the data so that it can be determined
where the data originated (on which node) and where the data's destination is.

An important aspect of the OSI model is that each layer in the stack provides services to
the layer directly above it. Only the layer, which is at the top of the stack,
would not provide services to a higher-level layer.

The process of moving user data down the OSI stack on a sending node (again, such as
a computer) is called . The process of moving raw data received by a node
up the OSI stack is referred to as - .

3.3 OSI Model 60


Elements of Computer Networking OSI and TCP/IP Models

Data Data
Sender Receiver

Application Layer Application Layer

Presentation Layer Presentation Layer

Session Layer Session Layer

Transport Layer Transport Layer

Network Layer Network Layer

Data Link Layer Data Link Layer

Physical Layer Physical Layer

Physical Link

To encapsulate means to enclose or surround, and this is what happens to data that is
created at the Application layer and then moves down through the other layers of the
OSI model. A header, which is a segment of information affixed to the beginning of the
data, is generated at each layer of the OSI model, except for the Physical layer.
This means that the data is encapsulated in a succession of headers—first the
layer header, then the layer header, and so on. When the data
reaches the ℎ layer, it is like a candy bar that has been enclosed in several
different wrappers.
When the data is transmitted to a receiving node, such as a computer, the data travels
up the OSI stack and each header is stripped off of the data. First, the layer
header is removed, then the layer header, and so on. Also, the headers are not
just removed by the receiving computer; the header information is read and used to
determine what the receiving computer should do with the received data at each layer of
the OSI model.
In OSI model, the sending computer uses these headers to communicate with the
receiving computer and provide the receiving computer with useful. As the data travels
up the levels of the peer computer, each header is removed by its equivalent protocol.

These headers contain different information depending on the layer they receive the
header from, but tell the peer layer important information, including packet size,
frames, and datagrams.

Control is passed from one layer to the next, starting at the application layer in one
station, and proceeding to the bottom layer, over the channel to the next station and
back up the hierarchy.

3.3 OSI Model 61


Elements of Computer Networking OSI and TCP/IP Models

Each layer's header and data are called . Although it may seem confusing, each
layer has a different name for its service data unit. Here are the common names for
service data units at each level of the OSI model.

Layer Encapsulation
Name Devices Keywords/Description
# Units
Network services for application
7 Application data PC processes, such as file, print,
messaging, database services
Standard interface to data for the
application layer. MIME
6 Presentation data encoding, data encryption,
conversion, formatting,
compression
Inter host communication.
Establishes, manages and
5 Session data
terminates connection between
applications
Provides end-to-end message
delivery and error recovery
(reliability).
4 Transport segments
Segmentation/desegmentation of
data in proper sequence (flow
control).
Logical addressing and path
3 Network packets router determination. Routing.
Reporting delivery errors
Physical addressing and access
bridge, to media. Two sublayers: Logical
2 Data Link frames
switch, NIC Link Control (LLC) and Media
Access Control (MAC)
Binary transmission signals and
repeater,
encoding. Layout of pins,
1 Physical bits hub,
voltages, cable specifications,
transceiver
modulation

3.4 TCP/IP Model


The TCP/IP model is a networking model with a set of communication protocols for the
Internet and similar networks. It is commonly known as TCP/IP, because its
(TCP) and (IP) were the first networking
protocols defined in this model.

The TCP/IP model, similar to the OSI model, has a set of layers. The OSI has seven
layers and the TCP/IP model has or layers depending on different preferences.
Some people use the Application, Transport, Internet and Network Access layers.
Others split the layer into the Physical and Data Link components.

3.4 TCP/IP Model 62


Elements of Computer Networking OSI and TCP/IP Models

Data Data
Sender Receiver

Application Layer Application Layer

Transport Layer Transport Layer

Internet Internet

Network Access Network Access

Physical Link

The OSI model and the TCP/IP models were both created independently. The TCP/IP
network model represents reality in the world, whereas the OSI mode represents an
ideal.
Layer # Description Protocols
Defines TCP/IP application protocols and HTTP, Telnet, FTP, TFTP,
how host programs interface with transport SNMP, DNS, SMTP,
layer services to use the network. X Windows, other
application protocols
Provides communication session TCP, UDP, RTP
management between the nodes/computers.
Defines the level of service and status of the
connection used when transporting data.
Packages data into IP datagrams, which IP, ICMP, ARP, RARP
contain source and destination address
information that is used to forward the
datagrams between hosts and networks.
Performs routing of IP datagrams.
Specifies details of how data is physically Ethernet, Token Ring,
sent through the network, including how FDDI, X.25, Frame Relay,
bits are electrically signaled by hardware RS-2
devices that interface directly with a
network medium, such as coaxial cable,
optical fiber, or twisted-pair copper wire.

3.4.1 Application Layer


Application layer is the top most layer of four layer TCP/IP model. Application layer is
present on the top of the Transport layer. Application layer defines TCP/IP application
protocols and how host programs interface with transport layer services to use the
network.
This layer is comparable to the application, presentation, and session layers of the OSI
model all combined into one.
Application layer includes all the higher-level protocols like DNS (Domain Naming
System), HTTP (Hypertext Transfer Protocol), Telnet, FTP (File Transfer Protocol), SNMP

3.4 TCP/IP Model 63


Elements of Computer Networking OSI and TCP/IP Models

(Simple Network Management Protocol), SMTP (Simple Mail Transfer Protocol), DHCP
(Dynamic Host Configuration Protocol), RDP (Remote Desktop Protocol) etc.

3.4.2 Transport Layer


Transport Layer is the third layer of the four layer TCP/IP model. The position of the
Transport layer is between Application layer and Internet layer.
Transport layer (also called - - protocol) in the TCP/IP model provides more or
less the same services with its equivalent Transport layer in the OSI model. This layer
acts as the delivery service used by the application layer. Again the two protocols used
are TCP and UDP. The choice is made based on the application's transmission reliability
requirements.
It also ensures that data arrives at the application on the host for which it is targeted.
Transport layer manages the flow of traffic between two hosts or devices. The transport
layer also handles all error detection and recovery. It uses checksums,
acknowledgements, and timeouts to control transmissions and end to end verification.

3.4.3 Internet Layer


Internet layer in TCP/IP model provides same services as the OSI model Network layer.
Their purpose is to route packets to destination independent of the path taken.
The routing and delivery of data is the responsibility of this layer and is the key
component of this architecture. It allows communication across networks of the same
and different types, and performs translations to deal with dissimilar data addressing
schemes. It injects packets into any network and delivers them to the destination
independently to one another.
Since the path through the network is not predetermined, the packets may be received
out of order. The upper layers are responsible for the reordering of the data. This layer
can be compared to the network layer of the OSI model.
The main protocols included at Internet layer are IP (Internet Protocol), ICMP (Internet
Control Message Protocol), ARP (Address Resolution Protocol), RARP (Reverse Address
Resolution Protocol) and IGMP (Internet Group Management Protocol).

3.4.4 Network Access Layer


Network Access Layer is the first layer of the four layer TCP/IP model. Network Access
layer defines details of how data is physically sent through the network. That means
how bits are electrically or optically sent by hardware devices that interface directly with
a network medium (such as coaxial cable, optical fiber, or twisted pair copper wire).
The protocols included in Network Access layer are Ethernet, Token Ring, FDDI, X.25,
Frame Relay etc.
The most popular LAN architecture among those listed above is Ethernet. Ethernet uses
an ℎ called / (Carrier Sense Multiple Access/Collision Detection) to
access the media. An access method determines how a host will place data on the
medium.
In CSMA/CD access method, every host has equal access to the medium and can place
data on the wire when the wire is free from network traffic. When a host wants to place
data on the wire, it will check the wire to find whether another host is already using the
medium.
If there is traffic already in the medium, the host will wait and if there is no traffic, it
will place the data in the medium. But, if two systems place data on the medium at the

3.4 TCP/IP Model 64


Elements of Computer Networking OSI and TCP/IP Models

same instance, they will collide with each other, destroying the data. If the data is
destroyed during transmission, the data will need to be retransmitted. After collision,
each host will wait for a small interval of time and again the data will be retransmitted.
This is a combination of the Data Link and Physical layers of the OSI model which
consists of the actual hardware.

3.5 Difference between OSI and TCP/IP models


The OSI model describes computer networking in seven layers. The TCP/IP model uses
four layers to perform the functions of the seven-layer OSI model. The network access
layer is functionally equal to a combination of OSI physical and data link layers.
The Internet layer performs the same functions as the OSI network layer. Things get a
bit more complicated at the host-to-host layer of the TCP/IP model. If the host-to-host
protocol is TCP, the matching functionality is found in the OSI transport and session
layers.
Using UDP equates to the functions of only the transport layer of the OSI model. The
TCP/IP process layer, when used with TCP, provides the functions of the OSI model’s
presentation and application layers. When the TCP/IP transport layer protocol is UDP,
the process layer’s functions are equivalent to OSI session, presentation, and
application layers.

3.5.1 OSI comparison with TCP/IP Protocol Stack


The main differences between the two models are as follows:
 OSI is a reference model and TCP/IP is an implementation of OSI model.
 TCP/IP protocols are considered to be standards around which the internet has
developed. The OSI model however is a , - standard.
 TCP/IP combines the presentation and session layer issues into its application
layer.
 TCP/IP combines the OSI data link and physical layers into the network access
layer.
 TCP/IP appears to be a simpler model and this is mainly due to the fact that it
has fewer layers.
 TCP/IP is considered to be a more credible model- This is mainly due to the fact
because TCP/IP protocols are the standards around which the internet was
developed therefore it mainly gains creditability due to this reason. Where as in
contrast networks are not usually built around the OSI model as it is merely
used as a guidance tool.
 The OSI model consists of 7 architectural layers whereas the TCP/IP only has 4
layers.

OSI OSI Layer TCP/IP TCP/IP Encapsulation


TCP/IP Protocols
# Name # Layer Name Units
FTP, HTTP, POP3,
7 Application data IMAP, telnet,
SMTP, DNS, TFTP
4 Application
6 Presentation data
5 Session data
4 Transport 3 Transport segments TCP, UDP
3 Network 2 Internet packets IP

3.5 Difference between OSI and TCP/IP models 65


Elements of Computer Networking OSI and TCP/IP Models

2 Data Link Network frames


1
1 Physical Access bits

3.6 How does TCP/IP Model (Internet) work?


As we have seen, there are a set of protocols that support computer networks.
Computers on the Internet communicate by exchanging packets of data, called Internet
Protocol (IP) . IP is the network protocol used to send information from one
computer to another over the Internet.
All computers on the Internet communicate using IP. IP moves information contained in
IP packets. The IP packets are routed via special routing algorithms from a source to
destination. The routing algorithms figure out the best way to send the packets from
source to destination.
In order for IP to send packets from a source computer to a destination computer, it
must have some way of identifying these computers. All computers on the Internet are
identified using one or more IP addresses. A computer may have more than one IP
address if it has more than one interface to computers that are connected to the
Internet.
IP addresses are 32-bit numbers. They may be written in decimal, hexadecimal, or other
formats, but the most common format is dotted decimal notation. This format breaks
the 32-bit address up into four bytes and writes each byte of the address as unsigned
decimal integers separated by dots. For example, one of . IP addresses is
0 499 1. Since, 0 = 204, 0 4 = 212, 0 99 = 153, and 0 1 = 193,
. IP address in dotted decimal form is [Link].

3.6.1 Domain Name System (DNS)


IP addresses are not easy to remember, even using dotted decimal notation. The
Internet has adopted a mechanism, referred to as the (DNS),
whereby computer names can be associated with IP addresses. These computer names
are called . The DNS has several rules that determine how domain names
are constructed and how they relate to one another. The mapping of domain names to
IP addresses is maintained by a system of . These servers are able
to look up the IP address corresponding to a domain name. They also provide the
capability to look up the domain name associated with a particular IP address, if one
exists.

3.6.2 TCP and UDP


Computers running on the Internet communicate to each other using either the
Transmission Control Protocol (TCP) or the User Datagram Protocol (UDP). When we
write programs that communicate over the network, we are programming at the
application layer. Typically, we don't need to concern with the TCP and UDP layers.
Instead, we can use the classes in the [Link] package. These classes provide system-
independent network communication. However, to decide which classes our
programs should use, we do need to understand how TCP and UDP differ.

[Link] TCP [Transmission Control Protocol]


When two applications want to communicate to each other reliably, they establish a
connection and send data back and forth over that connection. This is analogous to
making a telephone call. If we want to speak to a person who is in another country, a
connection is established when we dial the phone number and the other party answers.

3.6 How does TCP/IP Model (Internet) work? 66


Elements of Computer Networking OSI and TCP/IP Models

We send data back and forth over the connection by speaking to one another over the
phone lines. Like the phone company, TCP guarantees that data sent from one end of
the connection actually gets to the other end and in the same order it was sent.
Otherwise, an error is reported.
TCP provides a point-to-point channel for applications that require reliable
communications. The Hypertext Transfer Protocol (HTTP), File Transfer Protocol (FTP),
and Telnet are all examples of applications that require a reliable communication
channel. The order in which the data is sent and received over the network is critical to
the success of these applications. When HTTP is used to read from a URL, the data
must be received in the order in which it was sent. Otherwise, we end up with a
jumbled HTML file, a corrupt zip file, or some other invalid information.
Application: HTTP, ftp, telnet, SMTP,…
Transport: TCP, UDP,…
Network: IP,…
Link: Device driver,…

: TCP is a connection-based protocol that provides a reliable flow of data


between two computers.
Transport protocols are used to deliver information from one port to another and
thereby enable communication between application programs. They use either a
connection-oriented or connectionless method of communication. TCP is a connection-
oriented protocol and UDP is a connectionless transport protocol.
The reliability of the communication between the source and destination programs is
ensured through error-detection and error-correction mechanisms that are
implemented within TCP. TCP implements the connection as a stream of bytes from
source to destination. This feature allows the use of the stream I/O classes provided by
[Link].

[Link] UDP [User Datagram Protocol]


The UDP protocol provides for communication that is not guaranteed between two
applications on the network. UDP is not connection-based like TCP. But, it sends
independent packets of data (called datagrams) from one application to another. Sending
datagrams is much like sending a letter through the postal service: The order of delivery
is not important and is not guaranteed, and each message is independent of any other.

: UDP is a protocol that sends independent packets of data, called


, from one computer to another with no guarantees about arrival. UDP is not
connection-based.

For many applications, the guarantee of reliability is critical to the success of the
transfer of information from one end of the connection to the other. However, other
forms of communication don't require such strict standards. In fact, they may be
slowed down by the extra overhead or the reliable connection may invalidate the service
altogether.
Consider, for example, a clock server that sends the current time to its client when
requested to do so. If the client misses a packet, it doesn't really make sense to resend
it because the time will be incorrect when the client receives it on the second try. If the
client makes two requests and receives packets from the server out of order, it doesn't
really matter because the client can figure out that the packets are out of order and

3.6 How does TCP/IP Model (Internet) work? 67


Elements of Computer Networking OSI and TCP/IP Models

make another request. The reliability of TCP is unnecessary in this instance because it
causes performance degradation and may hinder the usefulness of the service.

Another example of a service that doesn't need the guarantee of a reliable channel is the
ping command. The purpose of the ping command is to test the communication
between two programs over the network. In fact, ping needs to know about dropped or
out-of-order packets to determine how good or bad the connection is. A reliable channel
would invalidate this service altogether.

The UDP protocol provides for communication that is not guaranteed between two
applications on the network. UDP is not connection-based like TCP. Rather, it sends
independent packets of data from one application to another. Sending datagrams is
much like sending a letter through the mail service: The order of delivery is not
important and is not guaranteed, and each message is independent of any others.

The UDP connectionless protocol differs from the TCP connection-oriented protocol in
that it does not establish a link for the duration of the connection. An example of a
connectionless protocol is postal mail. To mail something, you just write down a
destination address (and an optional return address) on the envelope of the item you're
sending and drop it in a mailbox. When using UDP, an application program writes the
destination port and IP address on a datagram and then sends the datagram to its
destination. UDP is less reliable than TCP because there are no delivery-assurance or
error-detection and error-correction mechanisms built into the protocol.

Application protocols such as FTP, SMTP, and HTTP use TCP to provide reliable,
stream-based communication between client and server programs. Other protocols,
such as the Time Protocol, use UDP because speed of delivery is more important than
end-to-end reliability.

3.7 Understanding Ports


Generally speaking, a computer has a single physical connection to the network. All
data destined for a particular computer arrives through that connection. However, the
data may be intended for different applications running on the computer. So, how does
the computer know to which application to forward the data? Through the use of ports.
Data transmitted over the Internet is accompanied by addressing information that
identifies the computer and the port for which it is destined. The computer is identified
by its 32-bit IP address, which IP uses to deliver data to the right computer on the
network. Ports are identified by a 16-bit number, which TCP and UDP use to deliver the
data to the right application.
In connection-based communication such as TCP, a server application binds a socket to
a specific port number. This has the effect of registering the server with the system to
receive all data destined for that port. A client can then rendezvous with the server at
the server's port, as illustrated here:
P
o TCP
Server Client
r
t

: The TCP and UDP protocols use ports to map incoming data to a particular
process running on a computer.
In datagram-based communication such as UDP, the datagram packet contains the
port number of its destination and UDP routes the packet to the appropriate
application, as illustrated in this figure:
3.7 Understanding Ports 68
Elements of Computer Networking OSI and TCP/IP Models

App App App App

Port Port Port Port

TCP or UDP
Packet
Data Port# Data

Port numbers range from 0 to 65,535 because ports are represented by 16-bit numbers.
The port numbers ranging from 0 - 1023 are restricted; they are reserved for use by
well-known services such as HTTP and FTP and other system services. These ports are
called well − known ports. Your applications should not attempt to bind to them.
Port Protocol
21 File Transfer Protocol
23 Telnet Protocol
25 Simple Mail Transfer Protocol
80 Hypertext Transfer Protocol

Problems and Questions with Answers


Question 1: A system has a -layer protocol hierarchy. Applications generate messages
of length bytes. At each of the layers, an ℎ-byte header is added. What fraction of
the network bandwidth is filled headers?
:
Given data:
 -layered protocol.
 Each layer adds a ℎ – byte header.
Hence, the total number of header bytes per message is ℎ .
So the relative space wasted on header is .

Question 2: Which answer correctly lists the OSI PDUs in order?


A) Data, Packet, Frame, Segment, Bit
B) Bit, Data, Packet, Segment, Frame
C) Data, Segment, Packet, Frame, Bit
D) Bit, Frame, Segment, Packet, Data
:C
Question 3: Which of the following are true when comparing TCP/IP to the OSI
Reference Model? (Choose two.)
A) The TCP/IP model has seven layers while the OSI model has only four layers.
B) The TCP/IP model has four layers while the OSI model has seven layers.
C) The TCP/IP Application layer maps to the Application, Session, and Presentation
layers of the OSI Reference Model.
D) The TCP/IP Application layer is virtually identical to the OSI Application layer.
: B and C
Question 4: In which layer of the TCP/IP stack is framing found?
A) Network B) Data Link C) Internet D) Network Access
:D

3.7 Understanding Ports 69


Elements of Computer Networking OSI and TCP/IP Models

Question 5: Which OSI layer is concerned with reliable end-to-end delivery of data?
A) Application B) Transport C) Network D) Data Link
:B
Question 6: Logical addressing is found in the ____ layer, while physical addressing is
found in the __ layer.
A) Physical, Network B) Network, Physical
C) Data Link, Network D) Network, Data Link
:D
Question 7: The OSI Reference Model layers, in order from top to bottom, are:
A) Application, Physical, Session, Transport, Network, Data Link, Presentation
B) Application, Presentation, Network, Session, Transport, Data Link, Physical
C) Physical, Data Link, Network, Transport, Session, Presentation, Application
D) Application, Presentation, Session, Transport, Network, Data Link, Physical
:D
Question 8: The process-to-process delivery of the entire message is the responsibility
of the ___ layer.
A) Network B) Transport C) Application D) Physical
:B
Question 9: The ___ layer is the layer closest to the transmission medium.
A) Physical B) Data link C) Network D) Transport
:A
Question 10: Mail services are available to network users through the __ layer.
A) Data link B) Physical C) Transport D) Application
:D
Question 11: As the data packet moves from the lower to the upper layers, headers are
__
A) Added B) Subtracted C) Rearranged D) Modified
:B
Question 12: As the data packet moves from the upper to the lower layers, headers are
___
A) Added B) Removed C) Rearranged D) Modified
:A
Question 13: The __ layer lies between the network layer and the application layer.
A) Physical B) Data link C) Transport D) None of the above
:C
Question 14: Layer 2 lies between the physical layer and the __ layer.
A) Network B) Data link C) Transport D) None of the above
:A
Question 15: When data are transmitted from device A to device B, the header from A’s
layer 4 is read by B’s __ layer.
A) Physical B) Transport C) Application D) None of the above
:B
Question 16: The ___ layer changes bits into electromagnetic signals.
A) Physical B) Data link C) Transport D) None of the above

3.7 Understanding Ports 70


Elements of Computer Networking OSI and TCP/IP Models

:A
Question 17: The physical layer is concerned with the transmission of ___over the
physical medium.
A) Programs B) Dialogs C) Protocols D) Bits
:D
Question 18: Which layer functions as a connection between user support layers and
network support layers?
A) Network layer B) Physical layer C) Transport layer D) Application layer
:C
Question 19: What is the main function of the transport layer?
A) Node-to-node delivery B) Process-to-process delivery
C) Synchronization D) Updating and maintenance of routing tables
:B
Question 20: Which of the following is an application layer service?
A) Remote log-in B) File transfer and access
C) Mail service D) All the above
:D
Question 21: Best effort means packets are delivered to destinations as fast as possible.
Is it true or false?
: False. Best effort refers to no guarantees about performance of any kind, not
high performance.
Question 22: In the OSI model, the transport layer can directly invoke (use) the data link
layer. Is it true or false?
: False. In the OSI model a layer can only use the service provided by the layer
below it. In this case, the transport layer can only use the service provided by the
networking layer.
Question 23: Data are transmitted over an internet in packets from a source system to a
destination across a path involving a single network and routers. Is it true or false?
: False
Question 24: In TCP/IP model, exactly one protocol data unit (PDU) in layer is
encapsulated in a PDU at layer ( – 1). It is also possible to break one -level PDU
into multiple ( – 1)-level PDUs (segmentation) or to group multiple -level PDUs
into one ( – 1)-level PDU (blocking). In the case of segmentation, is it necessary
that each ( – 1)-level segment contain a copy of the n-level header?
In the case of blocking, is it necessary that each -level PDU retain its own header,
or can the data be consolidated into a single -level PDU with a single -level
header?
: . This would violate the principle of separation of layers. To layer ( – 1), the
-level PDU is simply data. The ( – 1) entity does not know about the internal format of
the -level PDU. It breaks that PDU into fragments and reassembles them in the proper
order.
Question 25: For the Question 24, in the case of blocking, is it necessary that each -
level PDU retain its own header, or can the data be consolidated into a single -level
PDU with a single -level header?
: Each -level PDU must retain its own header, for the same reason given in
Question 24.

3.7 Understanding Ports 71


Elements of Computer Networking OSI and TCP/IP Models

Question 26: A TCP segment consisting of 1500 bits of data and 20 bytes of header is
sent to the IP layer, which appends another 20 bytes of [Link] is then
transmitted through two networks, each of which uses a 3-byte packet header. The
destination network has a maximum packet size of 800 bits. How many bits,
including headers, are delivered to the network layer protocol at the destination?
: Data + Transport header + Internet (IP) header = 1820 bits. This data is
delivered in a sequence of packets, each of which contains 24 bits of network header
and up to 776 bits of higher-layer headers and/or data. Three network packets are
needed. Total bits delivered = 1820 + 3 × 24 = 1892 bits.
Question 27: In the OSI model, the _____ layer is concerned with finding the best path
for the data from one point to the next within the network.
A) Data Link B) Network C) Physical D) Application
:B
Question 28: Error detection is performed at the __ layer of the OSI model?
A) Data Link B) Transport C) Network D) Both a and b
:D
Question 29: ___ is a very powerful error detection technique and should be considered
for all data transmission systems?
A) Vertical redundancy check B) Cyclic redundancy checksum
C) Simple parity D) Horizontal parity
:B
Question 30: Which layer addresses do routers use to determine a packet's path?
A) Data Link B) Network C) Physical D) Application
:B
Question 31: Why does the data communication industry use the layered OSI reference
model?
1. It divides the network communication process into smaller and simpler
components, thus aiding component development, design, and troubleshooting.
2. It enables equipment from different vendors to use the same electronic
components, thus saving research and development funds.
3. It supports the evolution of multiple competing standards and thus provides
business opportunities for equipment manufacturers.
4. It encourages industry standardization by defining what functions occur at each
layer of the model.
A) 1 only B) 1 and 4 C) 2 and 3 D) 3 only
: B. The main advantage of a layered model is that it can allow application
developers to change aspects of a program in just one layer of the layer model's
specifications. Advantages of using the OSI layered model include, but are not limited
to, the following:
 It divides the network communication process into smaller and simpler
components, thus aiding compo- nent development, design, and
troubleshooting
 It allows multiple-vendor development through standardization of network
components
 It encourages industry standardization by defining what functions occur at
each layer of the model
 It allows various types of network hardware and software to communicate
Question 32: Which of the following functionalities must be implemented by a transport
protocol over and above the network protocol ?

3.7 Understanding Ports 72


Elements of Computer Networking OSI and TCP/IP Models

A) Recovery from packet losses


B) Detection of duplicate packets
C) Packet delivery in the correct order
D) End to end connectivity
: D. Transport protocols are mainly for providing end to end connections by
making sockets. Recovery from packet loss & delivery in correct order, duplication is
checked by Data link layer.
Question 33: Choose the best matching Group 1 and Group 2.
Group-1 Group-2
1. Ensures reliable transport of data over a physical point-to-
P. Data link layer
point link
Q. Network layer 2. Encodes/ decodes data for physical transmission
R. Transport layer 3. Allowed-to-end communication between two processes
A) P-1, Q-2, R-3 B) P-2, Q-3, R-1
C) P-2, Q-3, R-1 D) P-1, Q-3, R-2
: [Link] layer is responsible for end to end communication, creation of
sockets. Network layer routes the data from one node to other, till it reach to
destination. Datalink layer ensures reliable data transfer by error correction,
duplication check ordered delivery etc. P - 1, Q - 4, R - 3.
Question 34: Suppose we wanted to do a transaction from a remote client to a server as
fast as possible. Would you use UDP or TCP? Why?
: We would use UDP. With UDP, the transaction can be completed in one
roundtrip time (RTT) - the client sends the transaction request into a UDP socket, and
the server sends the reply back to the client's UDP socket. With TCP, a minimum of two
RTTs are needed - one to set-up the TCP connection, and another for the client to send
the request, and for the server to send back the reply.

3.7 Understanding Ports 73


Elements of Computer Networking Networking Devices

Chapter
Networking
Devices 4
4.1 Glossary
 : Network segments that typically use the same communication protocol
use bridges to pass information from one network segment to the other.
 : When different communications protocols are used by networks,
gateways are used to convert the data from the sender’s
 :Another name for a hub is a concentrator. Hubs reside in the core of the
LAN cabling system. The hub connects workstations and sends every
transmission to all the connected workstations.
 : A MDA is a plug-in module allowing selection among
fiber-optic, twisted pair, and coaxial cable.
 : When the electrical characteristics of various networks are
different, media filter adapter connectors make the connections possible.
 : MAUs are special concentrators or hubs for use in
Token Ring networks instead of Ethernet networks.
 : Modem is a device that digital signals to analog signals and
analog signals to digital signals.
 :NICs are printed circuit boards that are installed in
computer workstations. They provide the physical connection and circuitry
required to access the network.
 : Connectivity device used to regenerate and amplify weak signals, thus
extending the length of the network. Repeaters perform no other action on the
data.
 : Links two or more networks together, such as an Internet Protocol
network. A router receives packets and selects the optimum path to forward the
packets to other networks.
 ℎ: A connection device in a network that functions much like a bridge, but
directs transmissions to specific workstations rather than forwarding data to all
workstations on the network.
 : The name transceiver is derived from the combination of the words
transmitter and receiver. It is a device that both transmits and receives signals
and connects a computer to the network. A transceiver may be external or
located internally on the NIC.
 : Firewall provides controlled data access. Firewalls can be hardware or
software based and between networks. These are an essential part of a
network’s security strategy.

4.1 Glossary 74
Elements of Computer Networking Networking Devices

4.2 End Devices


In computer networks, the computers that we use on a daily basis are called (also
called ℎ or end systems). They are called ℎ because they host the application-
level programs such as a Web browser or an electronic-mail program.
Sometimes, they are also called as because they sit at the edge of the
network connection. A node can be a computer or some other device, such as a printer.
Every node has a unique network address, sometimes called a (DLC)
address or (MAC) address.
An end device acts as the source (i.e., generates and sends messages) or as the
destination (i.e., receives and consumes content) of the communication process.
In modern networks, a host can act as a client, a server, or both. Software installed on
the host determines which role it plays on the network. Servers are hosts that have
software installed that enables them to provide information and services, like e-mail or
web pages, to other hosts on the network.
Some examples of end devices are:
 Computers, laptops, file servers, web servers.
 Network printers
 VoIP phones
 Security cameras
 Mobile handheld devices

4.3 Intermediary Devices


In addition to the end devices that people are familiar with, computer networks depends
on intermediary devices to provide connectivity. These intermediary devices work
behind the scenes to ensure that data flows across the network. Also, they connect the
individual systems to the network and can connect multiple individual networks to form
an (also called ). Examples of intermediary network devices are:
 Network Access Devices (hubs, switches, and wireless access points)
 Internetworking Devices ( )
 Communication Servers and Modems
 Security Devices ( )
The management of data as it flows through the network is also a role of the
intermediary devices. These devices use the destination host address, along with
information about the network interconnections, to determine the path that messages
should take through the network. Processes running on the intermediary network
devices perform these functions:
 Regenerate and retransmit data signals
 Maintain information about what pathways exist through the network and
internetwork
 Notify other devices of errors and communication failures
 Direct data along alternate pathways when there is a link failure
 Classify and direct messages according to priorities
 Permit or deny the flow of data, based on security settings
The intermediate devices can be further classified by on their functionality as:
 : Connectivity devices are devices used to make physical
network connections. They do ℎ to the data or transmission
route. Connectivity devices operate at the physical layer of the OSI model.
 : Internetworking devices move data across a network.
They data to specific locations within the network and/or data
4.2 End Devices 75
Elements of Computer Networking Networking Devices

into alternative formats. Internetworking devices operate at OSI layers above


the physical layer.

4.4 Connectivity Devices


4.4.1 Introduction
Connectivity devices are those devices used to make physical network connections.
Connectivity devices operate at the physical layer of the Open Systems Interconnection
Reference Model (OSI) model. The OSI model describes how computer services and
procedures are standardized.
This standardization allows computers to share information and enables the
interconnection of various networking connectivity devices regardless of vendor.

4.4.2 Network Interface Cards


A is a piece of computer hardware and its main functionality is
to allow a computer to connect to a network. A network interface card is also called
LAN , , , or simply .
Regardless of the name, they enable computers to communicate across a network. With
this device, information packets can be transferred back and forth through a local area
network (LAN). It acts a communication source for sending and receiving data on the
network.

NIC provides physical access to a networking medium and often provides a low-level
addressing system through the use of MAC addresses. It allows users to connect to
each other either by using or .
The network interface card (NIC) is an add-on component for a computer, much like a
video card or sound card is. On most of the systems the NIC is integrated into the
system board. On others it has to be installed into an expansion slot.

Most network interface cards have the ℎ protocol as the language of the data
that is being transferred back and forth. However, network interface cards do not all

4.3 Intermediary Devices 76


Elements of Computer Networking Networking Devices

necessarily need physical Ethernet or other cables to be functional. Some have wireless
capabilities through including a small - that uses radio waves to transmit
information. The computer must have a software driver installed to enable it to interact
with the NIC. These drivers enable the operating system and higher-level protocols to
control the functions of the adapter.
Each NIC has a unique (MAC) address to direct traffic. This unique
MAC address ensures that information is only being sent to a specific computer name
and not to multiple ones if not intended to. Circled in the picture below is an example of
an integrated network interface card.
The MAC (Media Access Layer) address, or hardware address, is a 12-digit number
consisting of digits 0-9 and letters A-F. It is basically a hexadecimal number assigned to
the card. The MAC address consists of two pieces: the first signifies which vendor it
comes from, the second is the serial number unique to that manufacturer.
Example MAC addresses:
00-B0-D0-86-BB-F7 01-23-45-67-89-AB 00-1C-B3-09-85-15
The NIC performs the following functions:
 It translates data from the parallel data bus to a serial bit stream for
transmission across the network.
 It formats packets of data in accordance with protocol.
 It transmits and receives data based on the hardware address of the card.

4.4.3 Transceivers
The term does not necessarily describe a separate network device but rather
embedded in devices such as network cards.
Transceiver is a short name for - . It is a device that both transmits
and receives analog or digital signals. The term transceiver is used most frequently to
describe the component in local-area networks (LANs) that actually applies signals onto
the network wire and detects signals passing through the wire. For many LANs, the
transceiver is built into the network interface card (NIC). Older types of networks,
however, require an external transceiver.
The transceiver does not make changes to information transmitted across the network;
it adapts the signals so devices connected by varying media can interpret them. A
transceiver operates at the physical layer of the OSI model. Technically, on a LAN the
transceiver is responsible to place signals onto the network media and also detecting
incoming signals traveling through the same cable. Given the description of the function
of a transceiver, it makes sense that that technology would be found with network cards
(NICs).

4.4.4 Amplifiers and Repeaters


A repeater is an electronic device that receives a signal and retransmits it at a higher
level or higher power, so that the signal can cover longer distances without degradation.
Transmitter sends a signal containing some information and after travelling some
distance, usually, a signal get weakened (attenuated) due to energy loss in the medium.
Therefore, it should be improved (or ). is the circuit which magnifies
the weak signal to a signal with more power.
Sometimes, this signal attenuation happens much before the arrival to the destination.
In this case, signal is amplified and retransmitted with a power gain in one or more mid
points. Those points are called . Therefore an amplifier is an essential part of a
repeater.

4.3 Intermediary Devices 77


Elements of Computer Networking Networking Devices

Amplifier
Amplifier is an electronic circuit that increases the power of an input signal. There are
many types of amplifiers ranging from voice amplifiers to optical amplifiers at different
frequencies.

Repeater
The repeater is an electronic circuit that receives a signal and retransmits the same
signal with a higher power. Therefore, a repeater consists of a signal receiver, an
and a . Repeaters are often used in submarine communication
cables as signal would be attenuated to just a random noise when travelling such a
distance. Different types of repeaters have different types of configurations depending
on the transmission medium. If the medium is microwaves, repeater may consist of
antennas and waveguides. If the medium is optical it may contain photo detectors and
light emitters.

Difference between an Amplifier and a Repeater


1. Amplifier is used to magnify a signal, whereas repeater is used to receive and
retransmit a signal with a power gain.
2. Repeater has an amplifier as a part of it.
3. Sometimes, amplifiers introduce some noise to the signal, whereas repeaters
contain noise eliminating parts.

6000 meters

Repeater
Sending Node

Receiving Node

ℎ can normally transmit a distance of 500 meters and this can be extended by
introducing repeaters. ℎ can normally transmit a distance of 185 meters, and
can also be extended by using a repeater. This is the advantage to using a repeater. If a
network layout exceeds the normal specifications of cable we can use repeaters to build
network. This will allow for greater lengths when planning cabling scheme.
Repeaters no other action on the data. Repeaters were originally separate
devices. Today a repeater may be a separate device or it may be incorporated into a
hub. Repeaters operate at the physical layer of the OSI model.

4.3 Intermediary Devices 78


Elements of Computer Networking Networking Devices

4.4.5 Hubs

Hubs are commonly used to connect segments of a LAN. A hub contains multiple ports.
When a packet arrives at one port, it is copied to the other ports so that all segments of
the LAN can see all packets. A ℎ contains multiple ports. When a packet arrives at
one port, it is copied to all (broadcast) the ports of the hub. When the packets are
copied, the destination address in the frame does not change to a address. It
does this in a rudimentary way; it simply copies the data to all of the nodes connected
to the hub.
Hub

Hub Hub

The main function of the hub is to broadcast signals to different workstations in a LAN.
General speaking, the term hub is used instead of repeater when referring to the device
that serves as the center of a network.

4.4.6 Modems

Modem is a device that digital signals to analog signals and analog signals to
digital signals. The word modem stands for and . The process of
converting digital signals to analog signals is called . The process of
converting analog signals to digital signals is called . Modems are used
with computers to transfer data from one computer to another computer through
telephone lines.

Types of Modem Connections


Modems have two types of connections and they are.
4.3 Intermediary Devices 79
Elements of Computer Networking Networking Devices

 Analog connection
 Digital connection

Analog Connection
The connection between the modem and the telephone line is called a .
It converts digital signals from a computer to analogue signals that are then sent down
the telephone line. A modem on the other end converts the analogue signal back to a
digital signal the computer can understand. A workstation is connected to an analogue
modem. The analogue modem is then connected to the telephone exchange analogue
modem, which is then connected to the internet.

Analog Digital
Modem Modem

Digital Connection
The connection of modem to computer is called digital connection

Types of Modems
There are two types of modems:
 Internal modems
 External modems

Internal Modems
It fits into expansion slots inside the computer. It is directly linked to the telephone
lines through the telephone jack. It is normally less inexpensive than external modem.
Its transmission speed is also less external modem.

External Modems
It is the external unit of computer and is connected to the computer through serial port.
It is also linked to the telephone line through a telephone jack. External modems are
expensive and have more operation features and high transmission speed.

Advantages of Modems
 Inexpensive hardware and telephone lines
 Easy to setup and maintain

Disadvantage of Modems
 Very slow performance

4.4 Internetworking Devices


4.4.1 Bridges
Bridge is a device which operates in both the physical and the data link layer of the
OSI reference model. As a physical layer device, it the signal it receives. As a
data link layer device, the bridge can check the physical (MAC) addresses ( and
) contained in the frame.
Bridges can be used to divide a large network into . Bridges contain logic that
allows them to keep the traffic for each . When a new frame enters to a

4.4 Internetworking Devices 80


Elements of Computer Networking Networking Devices

bridge, the bridge not only regenerate the frame but it also checks the address of the
destination and forwards the new copy only to the segment to which the destination
address belongs. Ethernet LAN

Hub
Bridge

Apple LocalTalk LAN

A bridge device data traffic at a network boundary. Bridges reduce the amount of
on a LAN by dividing it into segments. Key features of a bridge are mentioned
below:
 A bridge operates both in physical and data-link layer
 A bridge uses a table for /
 A bridge does not ℎ the physical (MAC) addresses in a

[Link] Why Use Bridges?


As an example, imagine for a moment that computers are people in a room. Everyone is
glued to 1 spot and can't move around. If wants to talk to , he shouts out "
" and responds; and a conversation occur as a result.
On a small scale this works quite well. The Internet (as we know it today) is not just 2
or a few people talking directly to each other. The internet is literally billions of devices.
If they were all placed into the same room (network-segment); imagine what would
happen if wanted to talk to . would yell " !" and Ram's voice
would be lost in the crowd. Building a room to fit billions of people is equally ridiculous.
For this reason, networks are separated into smaller segments (smaller rooms) which
allow devices who are in the same segment (room) to talk directly to each other’s. But,
for the devices outside the segment we need some sort of device (router) to pass
messages from one room to the next room. But the vast number of segments (rooms)
means we need some sort of addressing scheme so the various routers in the middle
know how to get a message from to .
a large network with an interconnect device ( ) has many .
Among these are collisions (in an Ethernet network), contained ℎ
utilization, and the ability to filter out unwanted packets. Bridges were created to allow
network administrators to segment their networks transparently. What this means is
that individual stations need not know whether there is a bridge separating them or
not. It is up to the bridge to make sure that packets get properly forwarded to their
destinations. This is the fundamental principle underlying all of the bridging behaviours
we will discuss.

[Link] Types of Bridges


Several different types of bridges are available for internetworking LANs.

4.4 Internetworking Devices 81


Elements of Computer Networking Networking Devices

1. [ ]: Places incoming
frame onto all outgoing ports original incoming port.
2. : Stores the origin of a frame (from which port) and
later uses this information to place frames to that port.
3. : Uses a subset of the LAN topology for a loop-free
operation.
4. : Depends on routing information in frame to place the
frame to an outgoing port.

[Link].1 Transparent Basic Bridges [Transparent Forwarding Bridge]


The simplest type of bridge is called the . It is called
because the nodes using a bridge are unaware of its presence. This bridge receives
traffic coming in on each port and stores the traffic until it can be transmitted on the
outgoing ports. It will not forward the traffic from the port from which it was received.
The bridge does not make any conversion of the traffic. The bridge forwards ( and
) frames from one LAN to another. Obviously, the bridge forwards
all frames like a .

Transparent Bridge Forwarding


If the destination address is present in the forwarding database (table) already created,
the packet is forwarded to the port number to which the destination host is attached. If
it is not present, forwarding is done on all parts ( ). This process is called
.

Frame Received without


error on port X

Destination No
Yes
found in
table?
Forward frame to all
Direction = No
LANs except X
port X?
Forward frame to
Yes correct LAN

Count discarded
frames

Bridge forwarding operation is explained with the help of flowchart.

LAN-1 Bridge LAN-2

Node-A Node-B Node-C


In the figure above, consider three nodes A, B, and C. Assume each node sends frames
to all other nodes. The source addresses A, B are observed to be on network LAN-1,
while the address of node C will be observed to be on network LAN-2.
Basic functions of the bridge forwarding are mentioned below.

4.4 Internetworking Devices 82


Elements of Computer Networking Networking Devices

1. If the source address is present in the forwarding table, the bridge the
source address and corresponding interface to the table. It then checks the
destination address to determine if it is in the table.
2. If the destination address is listed in the table, it determines if the destination
address is on the same LAN as the source address. If it is, then the bridge
the frame since all the nodes have already received the frame.
3. If the destination address is listed in the table but is on a different LAN than
the source address, then the frame is forwarded to that LAN.
4. If the destination address is not listed in the table, then the bridge forwards the
frame to all the LANs except the one that which originally received the frame.
This process is called .
In some bridges, if the bridge has not accessed an address in the forwarding table over
a period of time, the address is removed to free up memory space on the bridge. This
process is referred to as .
Packets with a source A and destination B are received and discarded, since the node B
is directly connected to the LAN-1, whereas packets from A with a destination C are
forwarded to network LAN-2 by the bridge.

[Link].2 Transparent Bridge Learning


To learn which addresses are in use, and which ports (interfaces on the bridge) are
closest to, the bridge observes the headers of received frames. By examining the MAC
source address of each received frame, and recording the port on which it was received,
the bridge may learn which addresses belong to the computers connected via each port.
This is called .

The learned addresses are stored in the ( ) associated


with ℎ port ( ). Once this table has been setup, the bridge examines the
destination address of all received frames; it then scans the interface tables to see if a
frame has been received from the same address (i.e. a packet with a source address
matching the current destination address).

At the time of installation of a transparent bridge, the table is empty. When a packet is
encountered, the bridge checks its source address and build up a table by associating a
source address with a port address to which it is connected. The flowchart explains the
learning process.

Source No
found in
table?
Add source to table
Yes with direction and
timer
Update direction
and timer

Table Building
The table building up operation is illustrated in figure. Initially the table is empty.

4.4 Internetworking Devices 83


Elements of Computer Networking Networking Devices

Address Port

Node-A Node-B

LAN-1
Node-F

Port-1
Port-3
Bridge

Port-2
Node-E

LAN-2
LAN-3
Node-C Node-D

1. When node A sends a frame to node D, the bridge does not have any entry for
either D or A. The frame goes out from all three ports. The frame floods the
network. However, by looking at the source address, the bridge learns that node
A must be located on the LAN connected to port 1.
This means that frame destined for A (in future), must be sent out through port
1. The bridge adds this entry to its table. The table has its first entry now.
Address Port
A 1

2. When node E sends a frame to node A, the bridge has an entry for A, so it
forwards the frame only to port 1. There is no flooding. Also, it uses the source
address of the frame (E in this case), to add a second entry to the table.
Address Port
A 1
E 3

3. When node B sends a frame to C, the bridge has no entry for C, so once again it
floods the network and adds one more entry to the table.
Address Port
A 1
E 3
B 1
4. The process of learning continues as the bridge forwards frames.

Loop Problem
Forwarding and learning processes work without any problem as long as there is no
redundant bridge in the system. On the other hand, redundancy is desirable from the
viewpoint of reliability, so that the function of a failed bridge is taken over by a
redundant bridge.

The existence of redundant bridges creates the so-called loop problem as shown figure.
Assuming that after initialization tables in both the bridges are empty let us consider
the following steps:

4.4 Internetworking Devices 84


Elements of Computer Networking Networking Devices

Node-B

LAN-1

Bridge-A Bridge-B

LAN-2
Node-A

 1: Node A sends a frame to node B. Both the bridges forward the frame to
LAN 1 and update the table with the source address of A.
 2: Now there are two copies of the frame on LAN-1. The copy sent by
Bridge-A is received by Bridge-B and vice versa. As both the bridges have no
information about node B, both will forward the frames to LAN-2.
 3: Again both the bridges will forward the frames to LAN-1 because of the
lack of information of the node B in their database and again Step-2 will be
repeated, and so on.
So, the frame will continue to around the two LANs indefinitely.

[Link].3 Transparent Spanning Bridges


As seen in previous section, redundancy creates loop problem in the system and it is
undesirable. To prevent loop problem, the IEEE (Institute of Electrical and Electronics
Engineers) specification requires that the bridges use a special topology. Such a
topology is known as (a graph where there is no loop) topology.

The methodology for setting up a spanning tree is known as ℎ .


ℎ creates a tree out of a graph. Without changing the physical
topology, a logical topology is created that overlay on the physical by using the following
steps:

1. Select a bridge as - , which has the smallest ID.


2. Select root ports for all the bridges, except for the root bridge, which has least-
cost path (say, minimum number of hops) to the root bridge.
3. Choose a bridge, which has least-cost path to the - , in
each LAN.
4. Select a port as that gives least-cost path from the
to the bridge.
5. Mark the designated port and the root ports as ports and the
remaining ones as ports.

An Example
Let us walk through the below example for running the spanning tree algorithm on.
Note that some of the LAN segments have a cost 3 times that of others. The following
convention is used for the remaining discussion:
 DC means designated cost for a LAN segment
 Bridge-# means bridge number

4.4 Internetworking Devices 85


Elements of Computer Networking Networking Devices

 A number around a bridge is a port number

LAN-1 DC = 3

1 1 Root Bridge
Bridge-2 Bridge-1
2
2 3
DC = 3 LAN-2
LAN-3 DC = 1

1
1 1
Bridge-6
Bridge-3 Bridge-4
2
2
2 3
DC = 1 LAN-6
LAN-4 DC = 3

1
Bridge-5

2
LAN-5 DC = 3

Step 1 of the algorithm is already shown in the first picture: Bridge 1 is chosen as the
since all the bridges are assumed to have the same priority. The tie is
broken by choosing the bridge with the smallest ID number.
Next, we determine the root path cost (RPC) for each port on each bridge ℎ ℎ the
bridge. Then each bridge other than the root chooses its port with the lowest RPC
as the root port (RP). Ties are broken by choosing the - port. The root
port is used for all control messages from the root bridge to this particular bridge.

LAN-1 DC = 3

1 RPC = 3 1 Root Bridge


Bridge-2 Bridge-1
2
2 RPC = 1 3
DC = 3 LAN-2
LAN-3 RP DC = 1

RP RP 1 RPC = 3
1 RPC = 1 1 RPC = 1
Bridge-6
Bridge-3 Bridge-4
2 2 RPC = 2
2 RPC = 4 RPC = 4 3 DC = 1 RP LAN-6
LAN-4 DC = 3

RP
1 RPC = 4
Bridge-5
RPC = 7
2
LAN-5 DC = 3

4.4 Internetworking Devices 86


Elements of Computer Networking Networking Devices

: Consider port 1 of Bridge-5. Between it and root bridge we have


to traverse at least LAN-3 and LAN-4, with costs 1 and 3 respectively. Total cost is 4.
Thus RPC = 4 for port 1 of Bridge-5.
Next, step 3 of the algorithm is to select a designated bridge and a designated port on
this bridge for each LAN segment. This is the bridge that gives the least cost (DPC,
designated port cost) for getting between this LAN segment and the root bridge. The port
on this bridge by which we attach this LAN segment is called the (DP). If
there is a tie for the lowest DPC, the bridge with the smallest ID number is chosen.

The root bridge is always the designated bridge for the LAN segments directly attached
to it. The ports by which the root bridge attaches to the LAN segments are thus
designated ports. We assume that no LAN segment attaches to the root bridge by more
than 1 port. Since a root port cannot be chosen as a designated port, do not waste time
even considering root ports as possible designated ports.

In the drawing on the next page, we see that LAN-1, LAN-2, and LAN-3 are directly
attached to the root bridge via ports 1, 2, and 3 respectively on the root bridge. Thus we
only need to consider LAN-4, LAN-5, and LAN-6. LAN-4 could use either port 2 on
Bridge-3 or port 3 on Bridge-4 as its designated port. The DPC for each is 1 since
anything sent from LAN-4 through such a port goes across LAN-3 to the root bridge and
the cost of LAN-3 is just 1.

Since we have a tie for the DP we choose the one on the lowest number bridge. That
means that Bridge-3 is the designated bridge and its port 2 is the designated port for
LAN-3. For LAN-5 there is only one port that could be chosen, so the designated port for
LAN-5 is port 2 on Bridge-5 and the designated bridge is Bridge-5. There is no choice
for LAN-6 either as one port is a root port. Thus the designated port for S6 is the other
one: port 2 on Bridge-4.

LAN-1 DC = 3

1 DPC = 1 1 DP Root Bridge


Bridge-2 Bridge-1
2 DP
2 RP 3 DP
DC = 3 LAN-2
LAN-3 DC = 1

1
1 RP 1 RP
DP Bridge-6
DPC = 1
Bridge-3 Bridge-4
2 2
DP 2 DPC = 1 DPC = 1 3 DC = 1 RP LAN-6
LAN-4
DC = 3
1 RP

Bridge-5

2
LAN-5 DC = 3 DP DPC = 4

4.4 Internetworking Devices 87


Elements of Computer Networking Networking Devices

LAN-1 DC = 3

1 Block 1 DP
Root Bridge
Bridge-2 Bridge-1
2 DP
2 RP 3 DP
DC = 3 LAN-2
LAN-3 DC = 1

1 Block
1 RP 1 RP
DP Bridge-6
Bridge-3 Bridge-4
2 2 RP
DP 2 Block 3 DC = 1 LAN-6
LAN-4
DC = 3
1 RP

Bridge-5

2 DP
LAN-5 DC = 3

Finally, in step 4 each port that is not a root port or designated port is set to be in a
blocking state so that no traffic can flow through it. The blocked ports are X-ed out
above. This, then, produces our spanning tree (no loops). To better see the spanning
tree, the picture can be redrawn as shown on the next page, with the root bridge as the
root of the tree.

[Link].4 Translational Bridges

FDDI
Ring LAN Bridge
Ethernet LAN

Translational bridges are a type of transparent bridge that connects LANs that use
different protocols at the data link and physical layers, for example, FDDI (Fiber
Distributed Data Interface) and Ethernet.

[Link].5 Source Routing Bridges


In source routing bridges, the routing operation is determined by the source host and
the frame specifies which route the to follow. A host can discover a route by
sending a frame, which spreads through the entire network using all possible
paths to the destination.
Each frame gradually gathers addresses as it goes. The destination responds to each
frame and the source host chooses an appropriate route from these responses. For
example, a route with minimum ℎ - can be chosen. Whereas transparent bridges
do not modify a frame, a source routing bridge adds a routing information field to the
frame. Source routing approach provides a shortest path at the cost of extra burden on
the network.

4.4 Internetworking Devices 88


Elements of Computer Networking Networking Devices

Token Token
Ring LAN Bridge Ring LAN

Bridge

Token
Ring LAN

Source route bridging is used in token ring networks. A source route bridge links two or
more rings together. There are fundamental characteristics in how a source route bridge
transmits a frame between rings. A source route bridge does not create and maintain
forwarding tables. The decision to forward or drop a frame is based on information
provided in the frame.
The destination station is responsible for maintaining routing tables that define a route
to all workstations on the network. The source workstation is responsible for
determining the path of a frame to its destination. If no route information is available,
then the source station has the ability to perform route discovery to learn the potential
paths that can be taken.

4.4.2 Switches
ℎ is a device that filters and forwards packets between LAN segments. Switch
works at the layer 2 of the OSI model. The main purpose of the switch is to concentrate
connectivity while making data transmission more efficient. Think of the switch as
something that combines the connectivity of a hub with the traffic regulation of a bridge
on each port. Switches makes decisions based on MAC addresses.

A switch is a device that performs switching. Specifically, it forwards and filters OSI
layer 2 datagrams (chunk of data communication) between ports (connected cables)
based on the MAC addresses in the packets.
As discussed earlier, a hub forwards data to all ports, regardless of whether the data is
intended for the system connected to the port. This mechanism is inefficient; and
switches tries to address this issue to some extent. This is different from a hub in that
it only forwards the datagrams to the ports involved in the communications rather than

4.4 Internetworking Devices 89


Elements of Computer Networking Networking Devices

all ports connected. Strictly speaking, a switch is not capable of routing traffic based on
IP address (layer 3) which is necessary for communicating between network segments
or within a large or complex LAN.

[Link] How a Switch works?


Rather than forwarding data to all the connected ports, a switch forwards data only to
the port on which the destination system is connected. It looks at the Media Access
Control (MAC) addresses of the devices connected to it to determine the correct port.

Switch

Data
Data

Sending Node Receiving Node


A MAC address is a unique number that is stamped into every NIC. By forwarding data
only to the system to which the data is addressed, the switch decreases the amount of
traffic on each network link dramatically.

[Link] Switching Methods


We can specify one of possible forwarding methods for each port in a switch:
1. Cut-through
2. Fragment-free
3. Store-and-forward
4. Adaptive

[Link].1 Store and Forward Switching


In and switching, Switch copies each of the complete Ethernet frame into
the switch memory and computes a Cyclic Redundancy Check (CRC) for errors. If a
Cyclic Redundancy Check (CRC) error is found, the Ethernet frame is dropped and if
there is no Cyclic Redundancy Check (CRC) error, the switch forwards the Ethernet
frame to the destination device. Store and Forward switching can cause delay in
switching since Cyclic Redundancy Check (CRC) is calculated for each Ethernet frame.

[Link].2 Cut-through Switching


In -ℎ ℎ switching, the switch copies into its memory only the destination MAC
address (first 6 bytes of the frame) of the frame before making a switching decision. A
switch operating in cut-through switching mode reduces delay because the switch
starts to forward the Ethernet frame as soon as it reads the destination MAC address
and determines the outgoing switch port. Problem related with cut-through switching is
that the switch may forward bad frames.

[Link].3 Fragment-Free Switching


- switching is an advanced form of cut-through switching. The switches
operating in cut-through switching read only up to the destination MAC address field in
the Ethernet frame before making a switching decision. The switches operating in

4.4 Internetworking Devices 90


Elements of Computer Networking Networking Devices

fragment-free switching read at least 64 bytes of the Ethernet frame before switching it
to avoid forwarding Ethernet runt frames (Ethernet frames smaller than 64 bytes).

[Link].4 Adaptive switching


ℎ mode is a user-defined facility to maximize the efficiency of the
switch. Adaptive switching starts in the default switch forwarding mode we have
selected. Depending on the number of errors (say, CRC errors) at that port, the mode
changes to the of the other two switching modes.

4.4.3 Routers
[Link] What is Router?
are ℎ devices that join multiple together. Technically, a router is
a Layer 3 device, meaning that it connects two or more networks and that the router
operates at the network layer of the OSI model.
Routers maintain a table (called ) of the available routes and their
conditions and use this information along with distance and cost algorithms to
determine the best route for a given packet. Typically, a packet may travel through a
number of network points with routers before arriving at its destination.

The purpose of the router is to examine incoming packets (layer 3), chose the best path
for them through the network, and then switches them to the proper outgoing port.
Routers are the most important traffic controlling devices on large networks.
Routers are networking devices that forward data packets between networks using
headers and to determine the best path to forward the packets.
Routers also provide interconnectivity between and media (networks which
use different protocols).

[Link] Understanding Concepts of Routers


As an example, assume that we want to send a postcard just based on person names
(with minimum information). For example, s [USA], ℎ [India] or
[USA] it would be routed to them due to their fame; no listing of the
street address or the city name would be necessary. The postal system can do such
routing to famous personalities, depending on the name alone.

4.4 Internetworking Devices 91


Elements of Computer Networking Networking Devices

In an Internet, a similar discussion is possible: ℎ any anywhere in the world


without knowing where the site is currently located. Not only that, it is possible to do so
very efficiently, within a matter of a few seconds.

[Link].1 What is Network Routing?


How is this possible in a communication network, and how can it be done so quickly?
The answer to this question is . is the ability to send a
unit of information from source to destination by finding a path through the network,
and by doing efficiently and quickly.

[Link].2 What is Addressing?


First, we start with a key and necessary factor, called . In many ways,
addressing in a network has similarities to postal addressing in the postal system. So,
we will start with a brief discussion of the postal addressing system to relate them.
A typical postal address that we write on a postcard has several components—the name
of the person, followed by the street address with the house number (ℎ ),
followed by the city, the state name, and the postal code. If we take the processing view
to route the postcard to the right person, we essentially need to consider this address in
the reverse order of listing, i.e., start with the postal code, then the city or the state
name, then the house address, and finally the name of the person.
You may notice that we can reduce this information somewhat; that is, you can just use
the postal code and leave out the name of the city or the name of the state, since this is
redundant information. This means that the information needed in a postal address
consists of three main parts: the postal code, the street address (with the house
number), and the name.
A basic routing problem in the postal network is as follows:
1. The postcard is first routed to the city or the geographical region where the
postal code is located.
2. Once the card reaches the postal code, the appropriate delivery post office for
the address specified is identified and delivered to.
3. Next, the postman or postwoman delivers the postcard at the address, without
giving much consideration to the name listed on the card.
4. Rather, once the card arrives at the destination address, the residents at this
address take the responsibility of handing it to the person addressed.
The routing process in the postal system is broken down to three components:
 How to get the card to the specific postal code (and subsequently the post
office),
 How the card is delivered to the destination address, and
 Finally, how it is delivered to the actual person at the address.
If we look at it in another way, the place where the postcard originated in fact does not
need to know the detailed information of the street or the name to start with; the postal
code is sufficient to determine to which geographical area or city to send the card. So,
we can see that postal routing uses address hierarchy for routing decisions.
An advantage of this approach is the decoupling of the routing decision to multiple
levels such as the postal code at the top, then the street address, and so on. An
important requirement of this hierarchical view is that there must be a way to divide the
complete address into multiple distinguishable parts to help with the routing decision.
Now, consider an electronic communication network; for example, a critical
communication network of the modern age is the Internet. Naturally, the first question
that arises is: how does addressing work for routing a unit of information from one
point to another, and is there any relation to the postal addressing hierarchy that we

4.4 Internetworking Devices 92


Elements of Computer Networking Networking Devices

have just discussed? Second, how is service delivery provided? In the next section, we
address these questions.

[Link].3 Addressing and Internet Service: An Overview


In many ways, Internet addressing has similarities to the postal addressing system. The
addressing in the Internet is referred to as (IP) . An IP
address defines parts: one part that is similar to the postal code and the other part
that is similar to the house address; in Internet terminology, they are known as the
and the ℎ , to identify a network and a host address, respectively.
A host is the end point of communication in the Internet and where a communication
starts. A host is a generic term used for indicating many different entities; the most
common ones are a web-server, an email server, desktop, laptop, or any computer we
use for accessing the Internet. A identifies a contiguous block of addresses.

[Link].4 Network Routing: An Overview


In the previous section, we provided a broad overview of addressing and transfer
mechanisms for data in Internet communication services. Briefly, we can see that
eventually packets are to be routed from a source to a destination. Such packets may
need to traverse many cross-points, similar to traffic intersections in a road
transportation network. Cross-points in the Internet are known as .
A router’s functions are to read the destination address marked in an incoming IP
packet, to consult its internal information to identify an outgoing link to which the
packet is to be forwarded, and then to forward the packet. Similar to the number of
lanes and the speed limit on a road, a network link that connects two routers is limited
by how much data it can transfer per unit of time, commonly referred to as the band-
width or capacity of a link; it is generally represented by a data rate, such as 1.54
megabits per second (Mbps). A network then carries traffic on its links and through its
routers to the eventual destination; traffic in a network refers to packets generated by
different applications, such as web or email.

Note: For more about IP Addressing and routing, refer and


chapters.

[Link] Types of Routers


Depending on the role that routers perform, routers can be classified in many different
ways.

Internet

Exterior Routers Border Routers Interior Routers

4.4 Internetworking Devices 93


Elements of Computer Networking Networking Devices

[Link].1 Interior Routers


routers work within networks. These routers handle packets travelling between
nodes on the same Intra-network. An interior router is used to divide a large network
into more easily manageable subnetworks. It can keep one part of a network secure
from another and it can allow different technologies, for example, Ethernet and token
ring, to be used in the same network.

[Link].2 Border Routers


routers exist on one network and their function is to connect that network with
outside networks, including the Internet. They discover routes between the interior
network and others and they handle incoming and outgoing traffic.

[Link].3 Exterior Routers


routers are most common on the Internet. They do not exist on a particular
network but rather in the space between networks where data passes through on its
way to its destination. Exterior routers do not store routes to particular hosts; but they
store routes to other . Their primary role is to receive packets and then forward
them in the direction of their destination.

4.4.4 Gateways
The term is used in networking to describe the to the Internet. The
controls traffic that travels from the inside network to the Internet and
provides security from traffic that wants to enter the inside network from the Internet.

A network gateway is an internetworking system which joins two networks that use
different base protocols. A network gateway can be implemented completely in software,
completely in hardware, or as a combination of both. Depending on the types of
protocols they support, network gateways can operate at any level of the OSI model.

Since a gateway (by definition) appears at the edge of a network, related capabilities like
firewalls tend to be integrated with it. On home networks, a router typically serves as
the network gateway although ordinary computers can also be configured to perform
equivalent functions.

Sub-Network Gateway Sub-Network

Gateway
Sub-Network

Sub-Network Gateway
Sub-Network

As mentioned earlier, the Internet is not a single network but a collection of networks
that communicate with each other through gateways. A gateway is defined as a system
that performs relay functions between networks, as shown in figure above. The different
networks connected to each other through gateways are often called ,
because they are a smaller part of the larger overall network.
With TCP/IP, all interconnections between physical networks are through gateways. An
important point to remember for use later is that gateways route information packets

4.4 Internetworking Devices 94


Elements of Computer Networking Networking Devices

based on their destination network name, not the destination machine. Gateways are
completely transparent to the user.

4.4.1 Default Gateway


The default gateway is needed only for systems that are part of an internetwork (in the
above figure, note that two subnetworks connected to same gateway). Data packets with
a destination IP address not on the local subnet are forwarded to the default gateway.
The default gateway is normally a computer system or router connected to the local
subnet and other networks in the internetwork.

If the default gateway becomes unavailable, the system cannot communicate outside its
own subnet, except for with systems that it had established connections with prior to
the failure.

4.4.2 Multiple Gateways


If the default gateway becomes unavailable, data packets cannot reach their
destination. can be used to solve this problem.

4.4.3 Difference between Gateway and Router

[Link] Gateway
The between gateway and router is, gateway it is defined as a network
node that allows a network to interface with another network with different protocols. A
router is a device that is capable of sending and receiving data packets between
computer networks, also creating an overlay network.
Gateways and routers are two words are often confused due to their similarities. Both
gateways and routers are used to regulate traffic into more separate networks. However,
these are two different technologies and are used for different purposes.
The term gateway can be used to define two different technologies: gateway and default
gateway. These two terms should not be confused. In terms of communications
network, gateway it is defined as a network node that allows a network to interface with
another network with different protocols. In simple terms, gateway allows two different
networks to communicate with each other. It contains devices such as impedance
protocol translators, rate converters, or signal translators to allow system
interoperability.
A protocol translation/mapping gateway interconnects networks that have different
network protocol technologies. Gateways acts as a network point that acts as an
entrance to another network. The gateway can also allow the network to connect the
computer to the internet. Many routers are available with the gateway technology,
which knows where to direct the packet of data when it arrives at the gateway.
Gateways are often associated with both routers and switches.

Default gateway is a computer or a computer program that is configured to perform the


tasks of a traditional gateway. These are often used by ISP or computer servers that act
as gateway between different systems. When getting an internet connection, an ISP
usually provides a device that allows the user to connect to the Internet; these devices
are called . In organizational systems a computer is used as a node to connect
the internal networks to the external networks, such as the Internet.

4.4 Internetworking Devices 95


Elements of Computer Networking Networking Devices

[Link] Router
A router is a device that is capable of sending and receiving data packets between
computer networks, also creating an overlay network. The router connects two or more
data line, so when a packet comes in through one line, the router reads the address
information on the packet and determines the right destination, it then uses the
information in its routing table or routing policy to direct the packet to the next
network. On the internet, routers perform functions. Routers can also
be wireless as well as wired.
The most common type of routers is small office or home routers. These are used for
passing data from the computer to the owner's cable or DSL modem, which is
connected to the internet. Other routers are huge enterprise types that connect large
businesses to powerful routers that forward data to the Internet.
When connected in interconnected networks, the routers exchange data such as
destination addresses by using a dynamic routing protocol. Each router is responsible
for building up a table that lists the preferred routes between any two systems on the
interconnected networks. Routers can also be used to connect two or more logical
groups of computer devices known as subnets. Routers can offer multiple features such
as a DHCP server, NAT, Static Routing, and Wireless Networking.
These days’ routers are mostly available with built-in gateway systems make it easier
for users with them not having to buy separate systems.

4.4.5 Firewalls
The term firewall was derived from and intended to the
of fire from one to another. From the computer security perspective, the Internet is
an unsafe environment; therefore is an excellent metaphor for network
security. A firewall is a system designed to prevent unauthorized access to or from a
private network. Firewalls can be implemented in either hardware or software form, or a
combination of both. Firewalls prevent unauthorized users from accessing private
networks. A firewall sits between the two networks, usually a private network and a
public network such as the Internet.
F
I
R
E
Internal Network W Internet (Unsecure)
A
L
L

Connecting a computer or a network of computers may become targets for malicious


software and hackers. A firewall can offer the security that makes a computer or a
network less vulnerable.
Note: For more details, refer section in chapter.

4.4.6 Differences between Hubs, Switches, and Routers


Today most routers have something combining the features and functionality of a router
and switch/hub into a single unit. So conversations regarding these devices can be a
bit misleading — especially to someone new to computer networking.

4.4 Internetworking Devices 96


Elements of Computer Networking Networking Devices

The functions of a router, hub and a switch are all quite different from one another,
even if at times they are all integrated into a single device. Let's start with the hub and
the switch since these two devices have similar roles on the network. Each serves as a
central connection for all of your network equipment and handles a data type known as
frames. Frames carry the data. When a frame is received, it is amplified and then
transmitted on to the port of the destination PC. The big difference between these two
devices is in the method in which frames are being delivered.
In a hub, a frame to every one of its ports. It doesn't matter that the frame is
only destined for one port. The hub cannot distinguish which port a frame should be
sent to. Broadcasting it on every port ensures that it will reach its intended destination.
This places a lot of traffic on the network and can lead to poor network response times.
Additionally, a 10/100Mbps hub must share its bandwidth with each and every one of
its ports. So, when only one PC is broadcasting, it will have access to the maximum
available bandwidth. If, however, multiple PCs are broadcasting, then that bandwidth
will need to be divided among all of those systems, which will degrade performance.
A switch, however, keeps a record of the addresses of all the devices connected to
it. With this information, a switch can identify which system is sitting on which port.
So, when a frame is received, it knows exactly which port to send it to, without
significantly increasing network response times. And, unlike a hub, a 10/100Mbps
switch will allocate a full 10/100Mbps to each of its ports. So regardless of the number
of PCs transmitting, users will always have access to the maximum amount of
bandwidth. It's for these reasons why a switch is considered to be a much better choice
than a hub.
are completely different devices. Where a hub or switch is concerned with
transmitting frames, a router's job, as its name implies, is to route packets to other
networks until that packet ultimately reaches its destination. One of the key features of
a packet is that it not only contains data, but the destination address of where it's
going.
A router is typically connected to at least two networks, commonly two Local Area
Networks (LANs) or Wide Area Networks (WAN) or a LAN and its ISP's network, for
example, your PC or workgroup and EarthLink. Routers are located at gateways, the
places where two or more networks connect. Using headers and forwarding tables,
routers determine the best path for forwarding the packets. Router use protocols such

4.4 Internetworking Devices 97


Elements of Computer Networking Networking Devices

as ICMP to communicate with each other and configure the best route between any two
hosts.

Problems and Questions with Answers


Question 1: In modern packet-switched networks, the source host segments long,
application-layer messages (for example, an image or a music file) into smaller
packets and sends the packets into the network. The receiver then reassembles the
packets back into the original message. We refer to this process as
. Figure shows the end-to-end transport of a message with and without
message segmentation. Consider a message that is 9.0106 bits long that is to be
sent from source to destination in figure. Suppose each link in the figure is 1.5
Mbps. Ignore propagation, queuing, and processing delays.

Full Message
Packet Packet
Switch Switch

No Segmentation
Source Destination

Segment
Packet Packet
Switch Switch

With Segmentation
Source Destination
A) Consider sending the message from source to destination without message
segmentation. How long does it take to move the message from the source host to
the first packet switch? Keeping in mind that each switch uses store-and-forward
packet switching, what is the total time to move the message from source host to
destination host?
B) Now suppose that the message is segmented into 5,000 packets, with each
packet being 1,500 bits long. How long does it take to move the first packet from
source host to the first switch? When the first packet is being sent from the first
switch to the second switch, the second packet is being sent from the source host to
the first switch. At what time will the second packet be fully received at the first
switch?
C) How long does it take to move the file from source host to destination host when
message segmentation is used? Compare this result with your answer in part (A)
and comment.
:
×
A) Time to send message from source host to first packet switch = sec = 6 sec.
. ×
With store-and-forward switching, the total time to move message from source host to
destination host = 6 sec × 3 hops = 18 sec.
. ×
B) Time to send 1st packet from source host to first packet switch = sec = 1 msec.
. ×

Time at which second packet is received at the first switch = 1.5 × 10 time at which
first packet is received at the second switch = 2 × 1 msec = 2 msec.
C) Time at which 1st packet is received at the destination host = 1 msec × 3 hops = 3
msec . After this, every 1msec one packet will be received; thus time at which last
(5000 ) packet is received = 3 msec + 4999 × 1 msec = 5.002 sec.
It can be seen that delay in using message segmentation is significantly less (more than
rd).

4.4 Internetworking Devices 98


Elements of Computer Networking Networking Devices

Question 2: For the following statement, indicate whether the statement is True or
False.
Switches exhibit lower latency than routers.
: True. No routing table look-up, no delays associated with storing data ,
bits flow through the switch essentially as soon as they arrive.
Question 3: Packet switches have queues while circuit switches do not. Is it true or
false?
: False. Routers have queues; switches do not, even though the packet switch
must have more memory than a circuit switch to receive a full packet before it can
forward it on.
Question 4: Consider the arrangement of learning bridges shown in the following
figure. Assuming all are initially empty, give the forwarding tables for each of the
bridges B1-B4 after the following transmissions:

B3 C

A B1 B2

B4 D
D sends to C; A sends to D; C sends to A
: When D sends to C, all bridges see the packet and learn where D is. However,
when A sends to D, the packet is routed directly to D and B3 does not learn where A is.
Similarly, when C sends to A, the packet is routed by B2 towards B1 only, and B4 does
not learn where C is.
The forwarding table for Bridge B1:
Destination Next Hop
A A-Interface
C B2-Interface
D B2-Interface
The forwarding table for Bridge B2:
Destination Next Hop
A B1-Interface
C B3-Interface
D B4-Interface
The forwarding table for Bridge B3:
Destination Next Hop
C C-Interface
D B2-Interface
The forwarding table for Bridge B4:
Destination Next Hop
A B2-Interface
D D-Interface
Question 5: Which type of bridge observes network traffic flow and uses this
information to make future decisions regarding frame forwarding?
A) Remote B) Source routing C) Transparent D) Spanning tree

4.4 Internetworking Devices 99


Elements of Computer Networking Networking Devices

:C
Question 6: Learning network addresses and converting frame formats are the function
of which device?
A) Switch B) Hub C) MAU D) Bridge
:D
Question 7: The device that can operate in place of a hub is a:
A) Switch B) Bridge C) Router D) Gateway
:A
Question 8: Which of the following is NOT true with respective to a transparent bridge
and a router?
A) Both bridge and router selectively forward data packets
B) A bridge uses IP addresses while a router uses MAC addresses
C) A bridge builds up its routing table by inspecting incoming packets
D) A router can connect between a LAN and a WAN.
: B. Bridge is the device which work at data link layer whereas router works at
network layer. Both selectively forward packets, build routing table and connect
between LAN and WAN but since bridge works at data link it uses MAC addresses to
route whereas router uses IP addresses.

4.4 Internetworking Devices 100


Elements of Computer Networking LAN Technologies

Chapter

LAN Technologies 5
5.1 Introduction
The bottom two layers of the Open Systems Interconnection (OSI) model deal with the
physical structure of the network and the means by which network devices can send
information from one device on a network to another.
The data link layer controls how data packets are sent from one node to another.

Data Data
Sender Receiver

Application Layer Application Layer

Presentation Layer Presentation Layer

Session Layer Session Layer

Transport Layer Transport Layer

Network Layer Network Layer

Data Link Layer Data Link Layer

Physical Layer Physical Layer

Physical Link

5.1 Introduction 101


Elements of Computer Networking LAN Technologies

5.2 Types of Network Links


There are two types of network links: - - links, and links.

5.2.1 Broadcasting Network Links


Broadcast is a method of sending a signal where multiple nodes may hear a single
sender node. As an example, consider a conference room with full of people. In this
conference room, a single person starts saying some information loudly.
During that time, some people may be sleeping, and may not hear what person is
saying. Some people may not be sleeping, but not paying attention (they are able to
hear the person, but choose to ignore). Another group of people may not only be awake,
but be interested in what is being said. This last group is not only able to hear the
person speaking, but is also listening to what is being said.
In this example, we can see that a single person is broadcasting a message to all others
that may or may not be able to hear it, and if they are able to hear it, may choose to
listen or not.

[Link] Simplex Broadcasting Network


Radio and TV stations are a good examples of everyday life . In this
case the radio/TV stations are a type of communications called . In a simplex
type of communication, data is only expected to flow in one direction.

[Link] Half-Duplex Broadcasting Network


Conference-room meetings are another everyday example of a broadcast network. In
this example, everyone may speak to everyone else, but when more than one person
speaks, interference (collision) from multiple conversations may make it impossible to
listen to more than one conversation even though we can hear both conversations. In
this conference-room example, we can see parties are able to share access to a common
media (human voice as sound through the air.) They compete for access to speak, but
for the most part, only one person speaks at a time for everyone to hear. This is an
example of a type of communications called ℎ - .

[Link] Full-Duplex Broadcasting Network


Let us consider the singing competition where we can see a group of singers attempting
to sing in Harmony. They can each speak separately on their own, but if they speak on
different topics, the conveyed information for any of them may be lost by each other.
This is an example of another type of communication called - .

This means that they are not only able to speak, but listen at the same time they are
speaking. All of them will speak and listen at the same time. How is this possible? In
order to sing in harmony, each singer must be able to hear the frequencies being used
by the other singers, and strive to create a frequency with their voice that matches the
desired frequency to create that harmony.

This feed-back of each singer to listen to the collective, and possibly key into a specific
singer's voice is used by them as they sing to create the exact frequency needed, and
ensure their timing is the same as the rest of the singers. All members are able to hear
all other members, and speak at the same time. They are all acting as a -
communications in a broadcast network.

5.2 Types of Network Links 102


Elements of Computer Networking LAN Technologies

5.2.2 Point-to-Point Network Links


- - is a method of communication where one node speaks to another node. A
woman in a restaurant whispers to her husband a message. Nobody else in the
restaurant knows what was said. The conversation was only between them.

[Link] Simplex Point-to-Point Network


An example of a very simple point-to-point network could be a doorbell (the
circuit.) When the doorbell button is depressed at the front door, a signal is passed to
bell which performs its functions to announce the button has been depressed. The bell
does not send a message to button. The message travels only in one direction and takes
place between the button and the bell.

[Link] Half-Duplex Point-to-Point Network


As an example, let us assume that we have a couple who are openly affectionate, sat on
a bench in a park, and holding hands under a blanket.
Also, assume that this couple has their own code in holding hands for speaking to each
other. For example, 3 squeezes maps to and 4 squeezes of the hand maps to
. The wife squeezes her husband's hand 3 times. He gets this message, and
smiles (acknowledging the receipt of the message) and then returns a new message of 4
squeezes. She smiles (acknowledging her receipt of the message she felt.) If both parties
attempted to squeeze each other's hands at the same time, then the number of squeezes
may be confused. So we can see each party may speak through squeezing each other’s
hands, but only one may speak at a time.
This conversation takes place only between these two people. Here we see point-to-point
and ℎ - .

[Link] Full-Duplex Point-to-Point Network


Data can travel in both directions simultaneously. There is no need to switch from
transmit to receive mode like in half duplex. Full-duplex network operates like a two-
way, two-lane street. Traffic can travel in both directions at the same time.

5.3 Medium Access Control Techniques


As we have seen, networks can be divided into two types:
1) S ℎ communication network (also called - - , - - , and
ℎ ): - - communication is performed with the help of
transmission lines such as multiplexers and switches.
2) communication network: In this we have a medium which is shared
by a number of nodes. is a method of sending a signal where multiple
nodes may hear a single sender node.

Networks

Switched Networks Broadcast Networks

A point-to-point link consists of a single sender on one end of the link, and a single
receiver at the other end of the link. Many link-layer protocols have been designed for
point-to-point links; PPP (point-to-point protocol) and HDLC (High-level Data Link
Control) are two such protocols.

5.3 Medium Access Control Techniques 103


Elements of Computer Networking LAN Technologies

Now, let us consider a different kind of scenario in which we have a medium which is
shared by a number of users.

Shared Medium

Any user can broadcast the data into the network. Now whenever it is broadcasted
obviously there is a possibility that several users will try to broadcast simultaneously.
This problem can be addressed with medium access control techniques.
Now question arises how different users will send through the shared media. It is
necessary to have a protocol or technique to regulate the transmission from the users.
That means, at a time only one user can send through the media and that has to be
decided with the help of Medium Access Control (MAC) techniques. Medium access
control techniques determines the next user to talk (i.e., transmit into the channel).
A good example is something we are familiar with - a classroom - where teacher(s) and
student(s) share the same, single, broadcast medium. As humans, we have evolved a set
of protocols for sharing the broadcast channel ("Give everyone a chance to speak."
"Don't speak until you are spoken to." "Don't monopolize the conversation." "Raise your
hand if you have question." "Don't interrupt when someone is speaking." "Don't fall
asleep when someone else is talking.").
Similarly, computer networks have protocols called protocols. These
protocols control the nodes data transmission onto the shared broadcast channel.
There are various ways to classify multiple access protocols. Multiple access protocols
can be broadly divided into four types; random, round-robin, reservation and
channelization. These four categories are needed in different situations. Among these
four types, channelization technique is static in nature. We shall discuss each of them
one by one.
Broadcast Multiple Access Techniques

Static Channelization Techniques Dynamic Medium Access Techniques

TDMA
Random Access Techniques
FDM
A ALOHA Round-Robin Reservation

CDMA
CSMA Polling R-ALOHA

CSMA/CD Token Passing

CSMA/CA

5.4 Random Access Techniques


Random access method is also called - access. In this method, no
station is assigned to control another. Random MAC techniques can be further divided
into four different types; ALOHA, CSMA, CSMA/CD and CSMA/CA.

5.4 Random Access Techniques 104


Elements of Computer Networking LAN Technologies

When each node has a fixed flow of information to transmit (for example, a data file
transfer), reservation based access methods are useful as they make an efficient use of
communication resources. If the information to be transmitted is bursty in nature, the
reservation-based access methods are not useful as they waste communication
resources.
Random-access methods are useful for transmitting short messages. The random
access methods give freedom for each to get access to the network whenever the
user has information to send.

5.4.1 ALOHA
Aloha protocol was developed by at . In the
language, Aloha means , , and . University of Hawaii consists
of a number of islands and obviously they cannot setup wired network in these islands.
In the University of Hawaii, there was a centralized computer and there were terminals
distributed to different islands. It was necessary for the central computer to
communicate with the terminals and for that purpose developed a protocol
called ℎ .
Central Node
Random Access
Broadcast

Terminal-1
… Terminal-4

Terminal-2 Terminal-3

Central node and terminals (stations) communicate by using a wireless technique called
. Each of these stations can transmit by using frequency which is
access shared by all the terminals. After receiving the data, the central node
retransmits by using a frequency and that will be received by all terminals.
There are two different types of ALOHA:
1. Pure ALOHA
2. Slotted ALOHA

[Link] Pure Aloha


The first version of protocol given by works like this:
1. If a node has data to send, send the data
2. If the message collides with another transmission, try resending later
3. In case of collision, sender waits random time before retrying
This simple version is also called . Note that, in Pure ALOHA, sender does
not check whether the channel is busy before transmitting.

[Link].1 Frames in Pure ALOHA


Pure ALOHA assumes all frames have the same length. A shared communication
system like ALOHA requires a method for handling collisions. Collisions will occur when
two or more systems try to send data 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

5.4 Random Access Techniques 105


Elements of Computer Networking LAN Technologies

can listen to broadcasts on the medium, even its own, and determine whether the
frames were transmitted.

A Frame-A.1 Frame-A.2

B Frame-B.1 Frame-B.2

C Frame-C.1 Frame-C.2

D Frame-D.1 Frame-D.2

Time
Collision Durations
As shown in diagram, 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.

[Link].2 Pure ALOHA Protocol


Pure ALOHA uses two different frequencies for data transfers. The central node
broadcasts packets to everyone on the outbound (also called ) channel, and the
terminals sends data packets to the central node on the inbound (also called )
channel.
Node has Start
K: Number of attempts [back-off counter]
data to send
: Maximum propagation time
: Average transmission time for a frame
: Back-off time K=0

Wait for time


( =2× or 2× ) Send the frame

Choose a random Wait for time-out


number R between 0 period: 2×
and 2 − 1

No
No
> Got ACK?
K=K+1

Yes Yes

Abort is generally set to 15 Success

If data was received correctly at the central node, a short acknowledgment packet was
sent to the terminal; if an acknowledgment was not received by a terminal after a short
wait time, it would automatically retransmit the data packet after waiting a randomly
selected time interval. This acknowledgment mechanism was used to detect and correct
for collisions created when two terminals both attempted to send a packet at the same
time.

5.4 Random Access Techniques 106


Elements of Computer Networking LAN Technologies

 In pure ALOHA, the stations transmit frames whenever they have data to send.
 When two or more stations transmit at the same time, there will be a collision
and the frames will get 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 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.
Therefore pure ALOHA dictates that when time-out period passes, each station must
wait for a random amount of time before resending its frame. This will
reduce collisions.

[Link].3 Pure ALOHA Vulnerable Time


We use the term vulnerable period to indicate the period of time that a packet can
possibly collide with other packets. For the rest of discussion, assuming is the
average transmission time for a frame. In pure ALOHA, any node that has data to send
will send it. We can see that the vulnerable period is 2 × .
Node B’s end collides with Node A’s end collides with
node A’s beginning node C’s beginning

Frame-B.1

Frame-A.1

Frame-C.1

t- t t+
Time
Vulnerable Duration=2×

Packet transmitted within this range will overlap with other packets. As a result,
collision will occur and the central node will send the garble packet to terminals.
When the garble packet is received by all terminals; they will know that packet has not
been transmitted successfully and the terminals will perform retransmission. The
retransmission technique is used here whenever there is a collision.

[Link].4 Throughput of Pure ALOHA


To assess Pure ALOHA, we need to predict its throughput (the rate of successful
transmission of frames).
In the pure ALOHA, each station transmits information whenever the station has data
to send. Stations send data in packets. After sending a packet, the station waits a
length of time equal to the round-trip delay for an acknowledgment (ACK) of the packet
from the receiver.

5.4 Random Access Techniques 107


Elements of Computer Networking LAN Technologies

If no ACK is received, the packet is assumed to be lost in a collision and it is


retransmitted with a randomly selected delay to avoid repeated collisions.
Let us assume that is the average number of frames requested per frame-time and
is the throughput. Also assume that, stations are trying to send data follow Poisson
distribution.
Poisson distribution expresses the probability of a given number of events occurring in
a fixed interval of time and/or space; if these events occur with a known average rate
and independently of the time since the last event.
The throughput for pure ALOHA is,
= ×
From the above equation, we can see that the maximum throughput occurs at

G = 50% (i.e. ) and is S =1/2e.

This is about 0.184. So, the best channel utilization with the pure ALOHA protocol is
only 18.4%.
The probability of collision in pure ALOHA is,
1−
Where is the total time which is the sum of propagation and transmission times.

[Link] Slotted ALOHA


Slotted ALOHA is an improvement over the pure 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
. The size of the slot is equal to the frame size.

[Link].1 Frames in Slotted ALOHA


In slotted ALOHA, the stations can send a frame only at the beginning of the slot and
only one frame is sent in each slot. 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.
Collision Durations

A Frame-A.1 Frame-A.2

B Frame-B.1 Frame-B.2

C Frame-C.1 Frame-C.2

D Frame-D.1

Slots
Time

5.4 Random Access Techniques 108


Elements of Computer Networking LAN Technologies

[Link].2 Slotted ALOHA Vulnerable Time


As seen above, for pure ALOHA the vulnerable time is two slots (2 × ). In slotted
ALOHA, two packets either collide completely or do not overlap at all. The vulnerable
period is reduced to one slot ( ).
Node A’s collides with node C

Frame-B.1

Frame-A.1

Frame-C.1

t- t t+
Time
Vulnerable Duration=

[Link].3 Throughput of Slotted ALOHA


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 figure. Slotted ALOHA still has an edge over
pure ALOHA as chances of collision are reduced to one-half.
Let us assume that is the average number of frames requested per frame-time and
is the throughput. The throughput for slotted ALOHA is,
= ×
From the above equation, we can see that the maximum throughput occurs at traffic
load G = 100% (i.e. 1) and is S =1/e. This is about 0.368. So, the best channel
utilization with the slotted ALOHA protocol is only 36.8%.
The probability of collision in slotted ALOHA is,
1−
Where is the total time which is the sum of propagation and transmission times.

5.4.2 Carrier Sense Multiple Access [CSMA]


The main problem with ALOHA protocols (both pure and slotted ALOHA) is that, when a
node sends a packet other nodes does not know about that event. In case of pure and
slotted ALOHA the medium was not checked before sending the packet. This problem is
addressed in (CSMA).
The basic idea behind CSMA is, . If someone else is speaking, wait until
they are done. In networking terminology, this is called . That means, a
node listens to the channel before transmitting. If a frame from another node is
currently being transmitted into the channel, a node then waits ( ) a random
amount of time and then again senses the channel.
If the channel is sensed to be idle, the node then begins frame transmission. Otherwise,
the node waits another random amount of time and repeats this process. CSMA reduces
the possibility of collision, but cannot completely eliminate it. There are three different
types of CSMA:

5.4 Random Access Techniques 109


Elements of Computer Networking LAN Technologies

1. 1-Persistent CSMA
2. Non-Persistent CSMA
3. p-Persistent CSMA

[Link] 1-Persistent CSMA

Yes
Channel
Busy?

No

Send data

In this method, station that wants to transmit data 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 1-persistent CSMA. This method has the
highest chance of collision because two or more nodes may find channel to be idle at
the same time and transmit their frames. When the collision occurs, the nodes wait a
random amount of time and start all over again.
Sense continuously

Sense and send

Frame Time

Channel busy Channel free

of 1-Persistent CSMA
The propagation delay greatly affects this protocol. As an example, just after the node-1
begins its transmission, node-2 also ready to send its data and senses the channel. If
the node-1 signal has not yet reached node-2, node-2 will sense the channel to be idle
and will begin its transmission. This will result in collision.
Even if propagation delay is zero, collision will still occur. If two nodes became ready in
the middle of third node's transmission, both nodes will wait until the transmission of
first node ends and then both will begin their transmission exactly simultaneously. This
will also result in collision.

[Link] Non-Persistent CSMA

Yes
Channel Wait for
Busy? random time

No

Send data

5.4 Random Access Techniques 110


Elements of Computer Networking LAN Technologies

In non-persistent CSMA, a node senses the channel. If the channel is busy, then the
node waits for a random amount of time and senses the channel again. After the wait
time, if the channel is idle then it sends the packet immediately. If a collision occurs
then the node waits for a random amount of time and start all over again.
In non-persistent CSMA, a node does not sense the channel continuously while it is
busy. Instead, after sensing the busy condition, it waits for a randomly selected interval
of time before sensing again.
Wait Wait

Sense Sense
Sense and send
Frame Time

Channel busy Channel free


In this protocol, if a node wants to transmit a frame and if it finds that the channel is
busy (some other node is using) then it will wait for random interval of time. After this
wait time, it again checks the status of the channel and if the channel is free it will
transmit.
In non-persistent CSMA the station does not continuously sense the channel for the
purpose of capturing it.

of Non-Persistent CSMA
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.

of Non-Persistent CSMA
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.

[Link] p-Persistent CSMA

Yes
Channel
Busy?

No

No No
Probability ≥ Wait for Channel
? Slot time Busy?

Yes Yes

Send data Acts as though a collision has


occurred and starts again

5.4 Random Access Techniques 111


Elements of Computer Networking LAN Technologies

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 . With the
probability = − , 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 and .
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.
Probability does not allow transmission
Sense continuously

Sense and send

Time Slots
Frame Time

Channel busy Channel free

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.

of p-persistent CSMA
It reduces the chance of collision and improves the efficiency of the network.

5.4.3 CSMA with Collision Detection [CSMA/CD]


Several improvements have been done to the basic CSMA. A considerable performance
improvement in the basic CSMA can be achieved with and that
technique is called ℎ (CSMA/CD).
The CSMA/CD protocols are same as CSMA with addition of the collision-detection
feature. Similar to CSMA protocols, there are 1-persistent, non-persistent, and p-
persistent CSMA/CD protocols.
Similar to CSMA, CSMA/CD is a protocol in which the station senses the channel
before sending frame. If the channel is busy, the station waits. Additional feature in
CSMA/CD is that the stations can detect the collisions.
The stations abort their transmission as soon as they detect a collision. In CSMA this
feature is not present. The stations continued their transmission even though they find
that the collision has occurred. This leads to the wastage of channel time.

[Link] How it Works?


In CSMA/CD, a node ℎ places data onto the channel after sensing the channel
to sense the channel even after the data transmission. If two or more nodes
sense the channel free at the same time, and begin transmitting at the same time, the
is sure.
Contention Periods

Frame Frame Frame Frame

Time
Channel busy Idle Channel

As soon as a collision is detected, the transmitting node releases a signal.


signal will alert the other nodes. As a result, transmitter’s stops transmissions by

5.4 Random Access Techniques 112


Elements of Computer Networking LAN Technologies

random intervals. This reduces the probability of a collision after the first retry. The
nodes are not supposed to transmit immediately after the collision has occurred.
Otherwise there is a possibility that the same frames would collide again.
CSMA/CD uses the electric activity on the cable to find the status of the channel. A
collision is detected by the of the received pulse and then comparing it with the
transmitted signal power.
After the collision is detected, the node stops transmitting and waits random amount of
time ( - time) and then sends its data again assuming that no other station is
transmitting in this time. This time slot called slot. If the collision occurs
again then the back-off delay time is progressively.
1. If the channel is idle, transmit; otherwise, go to Step 2.
2. If the channel is busy, continue sensing until the channel is idle, and then
transmit immediately.
3. If a collision is detected during transmission, send a jam signal to other nodes
sharing the medium saying that there has been a collision and then stop
transmission.
4. After sending the jam signal, wait for a random amount of time, then try
sending again.

K: Number of attempts [back-off counter] Station has


: Maximum propagation time Start
data to send
: Average transmission time for a frame
: Back-off time
K= 0

Apply one of the methods:


1-persistent, non-
persistent or p-persistent

Wait for time


( =R× or R× )

Sent data
collision found?
Choose a random
number R between 0 Yes
No
and 2 − 1
Send and receive
No
Send a Yes Collision
> K=K+1 jam signal found?

Yes No
is generally set to 15
Abort Success

[Link] CSMA/CD Frame Format


IEEE 802.3 (Ethernet) is an example of CSMA/CD. It is an international standard. Refer
ℎ section for more details.

5.4.4 CSMA with Collision Avoidance [CSMA/CA]


Another improvement for CSMA is collision avoidance. It is used to improve the
performance of the CSMA method. CSMA/CA (Carrier Sense Multiple Access/Collision
Avoidance) is a protocol used in wireless networks (IEEE 802.11 networks) because they

5.4 Random Access Techniques 113


Elements of Computer Networking LAN Technologies

cannot detect the collision. So, the only solution for wireless networks is collision
avoidance. In the previous section, we have seen that CSMA/CD deals with
transmissions after a collision has occurred. But, CSMA/CA acts to prevent collisions
before they happen.
In CSMA/CA, a station will signal its intention to transmit before it actually transmits data.
In this way, stations will sense when a collision might occur; this allows them to avoid
transmission collisions. Unfortunately, this broadcasting of the intention to transmit data
increases the amount of traffic on the channel and slows down network performance.
CSMA/CA avoids the collisions using three basic concepts.
1. Inter-frame space (IFS)
2. Contention window
3. Acknowledgements

Sense continuously Found idle


Send frame
Contention Period

Frame Frame Time-out

Channel busy IFS Time

[Link] Inter-frame Space (IFS)


Whenever the channel is found idle, the station transmit immediately. It waits
for a period of time called - space (IFS).
When channel idle, it may be possible that some distant station may have already
started transmitting and the signal of that distant station has not yet reached other
stations. The purpose of IFS time is to allow this transmitted signal to reach other
stations. If after this IFS time, the channel is still idle, the station can send, but it still
needs to wait a time equal to contention time. IFS variable can also be used to define
the priority of a station or a frame.

[Link] 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 back-off strategy. It means that; it
is a set with one slot at the first time and then doubles each time the station cannot
detect an idle channel after the IFS time.
This is very similar to the - 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 and restarts it when the channel is
sensed as idle.

[Link] Acknowledgements
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.

[Link] How it works?


In CSMA/CA, as soon as a station receives a packet that is to be sent, it checks to be
sure the channel is idle (no other node is transmitting at the time). If the channel is

5.4 Random Access Techniques 114


Elements of Computer Networking LAN Technologies

idle, then the packet is sent. If the channel is not idle, the stations waits for a randomly
chosen period of time, and then checks again to see if the channel is idle. This period of
time is called the - factor, and is counted down by a - counter.

Start
K: Number of attempts [back-off counter] Station has
: Maximum propagation time data to send
: Average transmission time for a frame
: Back-off time K= 0

Apply one of the methods:


1-persistent, non-
persistent or p-persistent

No
Channel Idle?

Yes

Wait for IFS time

No

Channel Still
Idle?

Yes

Choose a random
Contention window
number R between 0
size is 2 − 1
and 2 − 1

Wait for R slots

Send frameS

Wait time-out

No
No
K>15? K=K+1 Got ?

Yes Yes

Abort Success

If the channel is idle when the - counter reaches , the node transmits the
packet. If the channel is not idle when the - counter reaches , the -
factor is set again, and the process is repeated.

5.4 Random Access Techniques 115


Elements of Computer Networking LAN Technologies

5.5 Static Channelization Techniques


In the previous sections we discussed about the medium access control protocols like
ALOHA, CSMA and CSMA/CD. All these protocols were random in nature.
Channelization is a multiple access method in which the available bandwidth is shared in
time, frequency or using code by a number of stations. It is similar to multiplexing. Basic
idea of these approaches can be explained in simple terms using the cocktail party theory. In
a cocktail party people talk to each other using one of the following modes:
 Frequency Division Multiple Access [FDMA]
 Time Division Multiple Access [TDMA]
 Code Division Multiple Access [CDMA
Suppose a cocktail party is going on in a big area. In this scenario, there are three possible
alternatives.
In case when all the people group in widely separated areas and talk within each group.
That means in this case normally we have seen different people having different kinds of
interest (let us say; old people) and groups in different locations where the cocktail party is
going on, they talk among themselves and when all the people group in widely separated
areas and talk within each group we call it . That means as if we have assigned
different frequency bands to each of these groups and each of these groups are talking using
different frequency bands.
alternative is when all the people are in the middle of the room but they take turn in
speaking. Assume that some very important event is going on and all the people have
gathered at a central place and each of them is taking turn in talking. So, in this case it is
equivalent to. Here we have the basic approach, in terms of time the sharing is taking place.
Now the ℎ approach is interesting. When all the people are in a middle of the room
but different pairs speak in different languages. As an example, consider an international
conference. People from different countries will arrive there and obviously when they group
together they may be speaking in different languages.
Let’s assume that all of them have gathered near the central area but small groups are
talking in different languages, a group is talking in English, a group is talking in French, a
group is talking in German, another group is talking in may be Hindi. We can see that each
of these groups will start talking simultaneously; and since they are speaking different
languages the group talking in English although they are hearing the voices of people speak
in Hindi or French or German will not interfere with their discussion. Here simultaneously
all of them are talking but they are not interfering with each other because they are talking
in different languages. This is equivalent to .

5.5.1 Frequency Division Multiple Access [FDMA] Technique


: The number of cycles per unit of time is called the frequency. For
convenience, frequency is measured in cycles per second (cps) or Hertz (Hz). Hertz was
named after the 19th century German physicist ℎ .
tells the number of waves that pass a fixed place in a given amount of time.
For example, if the time taken for a wave to pass is 1/3 second, the frequency is 3 per
second. If it takes 1/200 of a second, the frequency is 200 per second.

5 cycles per 1 second = 5cps = 5Hz

5.5 Static Channelization Techniques 116


Elements of Computer Networking LAN Technologies

14 cycles per 1 second = 14cps = 14Hz

Now, let us focus on the concepts of (Frequency Division Multiplexing) and


(Frequency Division Multiple Access). FDM is a ℎ layer multiplexing technique. Using
FDM to allow multiple users to utilize the same bandwidth is called FDMA. FDM uses a
physical multiplexer. That means FDM works at the physical layer and allows multiple low
bandwidth frequency signals to share the same high bandwidth frequency range.

[Link] Frequency Division Multiplexing


Frequency Division Multiplexing (FDM) divides the single high bandwidth (with bigger
frequency range) channel into several smaller bandwidth channels (sub-channel). Each
sub channel transmits data simultaneously using different frequency so that each sub-
channel has its own frequency to use and is not affecting other sub-channels.

[Link] How does FDM works?


A radio is a good example to explain how FDM works. Note, that we are only using one
bigger range of radio frequency and there are several radio stations broadcasting its
service using different frequency. All we need to do is to adjust the radio to catch only
certain radio broadcast on certain frequency. FDM has drawback by dedicating such
frequency to several smaller circuits even though the designated channel is not using it.
f
f
Source-1 Source-2
… …

t t

… Common Channel

Data

f f

… …
Source-4
Source-3
t
t
At the receiving end of the system, bandpass filters are used to pass the desired signal
(the signal in the appropriate frequency sub-band) to the appropriate user and to block
all the unwanted signals.

5.5 Static Channelization Techniques 117


Elements of Computer Networking LAN Technologies

It is also appropriate to design an FDM system so that the bandwidth allocated to each
sub-band is slightly larger than the bandwidth needed by each source. This extra
bandwidth is called a - .

As we can see in figure, FDM divides one channel (with frequency between 0 Hz and 3000
Hz) into several sub-channels including the Guard-band. Guard-band acts as a
delimiter for each logical sub-channel so that the interference (crosstalk) from other
sub-channel can be minimized.

Modulator-1:
Generates a
signal in the
Source-1 frequency sub-
band between Guard-band
2000Hz and
2800Hz

Modulator -2:
Generates a
Channel capable of
signal in the
passing frequency
Source-2 frequency sub-
between 0 Hz and
band between
3000Hz
1000Hz and
1800Hz

Modulator -3:
Generates a
Source-3 signal in the
frequency sub-
band between 0
Hz and 800 Hz

For example, the multiplexed circuit is divided into 3 frequencies. Channel #1 (for
Source-1) using 0-800 Hz for its data transfer and delimited by 200 Hz Guard-band.
Channel #2 (for Source-2) using 1000-1800 Hz and delimited by 200 Hz too; and so on.

In regards to speed, we simply need to divide the main circuit amongst the available
sub-channels. For example, if we have a 64 Kbps physical circuit and wanted to use 4
sub-channels, each sub-channel will have 16 Kbps.

However, Guard-band is also using this 64 Kbps physical circuit and therefore each
channel will be using only 15 Kbps with 4 Guard-bands (1 Kbps per Guard-band). This
calculation depends on the specification.

[Link] FDM and FDMA


We can see the signal sent by different channels have been shown in a three
dimensional graph where the three dimensions are time, frequency and code. Also, we
can see the signals coming from different channels are only varying in terms of
frequency. However, in case of burst traffic (data that is transferred in short) the
efficiency can be improved in FDMA by using a dynamic sharing technique to access a
particular frequency band.

5.5 Static Channelization Techniques 118


Elements of Computer Networking LAN Technologies

Now, normally for each of these channels a frequency is statically allocated but if the
traffic is burst that means all the channels do not have data to send all the time. In
such a case there can be under utilization of the channels because a channel is
statically or permanently allocated to a particular station or user.

Code

Channel-n
Channel-1

Channel-2

Frequency
……

Time

What can be done to improve the utilization? Solution would be, instead of statically
allocating a channel to a station the channels can be assigned on demand.

That means depending on the requirement; channel can be allocated to different


stations or users and that makes FDMA Frequency Division Multiple Access.

That means not only the overall bandwidth is divided into a number of channels but
each channel can be allocated to a number of stations or users. If we have a number of
channels, we can use the below equation to find the number of channels that can be
used.
( × )
Number of channels, =

This is how we get the total number of channels that is possible in Frequency Division
Multiplexing.
If we have channels, since each channel can be shared by more than one user the
total number of stations that can be provided a service can be greater than . If it is
statically allocated then the total number of number of stations that can be used in
service is equal to .

However, since this is allocated or assigned dynamically on demand the total number of
stations can be larger than the number of channels. This is possible only when the
traffic is bursty and if the traffic is streamed (continuously sent) then of course it
cannot be done.

5.5.2 Time Division Multiple Access [TDMA] Technique


[Link] Time Division Multiplexing
The idea behind (TDM) is that if we have low-bit-rate streams
(channels) then merge them into a single high-speed bit stream.

5.5 Static Channelization Techniques 119


Elements of Computer Networking LAN Technologies

f f

Source-1 Source-2
… …
t t

… Common Channel

t
Data

f f

… …
Source-3 Source-4
t t
As an example, consider a channel with speed 192 kbit/sec from Hyderabad to Delhi.
Suppose that three sources, all located in Hyderabad, each have 64 kbit/sec of data
and they want to transmit to individual users in Delhi. As shown in Figure 7-2, the
high-bit-rate channel can be divided into a series of time slots, and the time slots can be
alternately used by the three sources.

The three sources are thus capable of sending all of their data across the single, shared
channel. Clearly, at the other end of the channel (in this case, in Delhi), the process
must be reversed (i.e., the system must divide the 192 kbit/sec multiplexed data stream
back into the original three 64 kbit/sec data streams, which are then provided to three
different users). This reverse process is called .

a a a
a a a
Demultiplexer
Multiplexer

a b c a b c a b c

b b b Hi-bit-rate multiplexed data stream


on a single high-capacity channel b b b

c c c
c c c
Low-bit-rate
Low-bit-rate
input channels
output channels

Choosing the proper size for the time slots involves a trade-off between efficiency and
delay. If the time slots are too small (say, one bit long) then the multiplexer must be fast
enough and powerful enough to be constantly switching between sources (and the
demultiplexer must be fast enough and powerful enough to be constantly switching
between users).

5.5 Static Channelization Techniques 120


Elements of Computer Networking LAN Technologies

If the time slots are larger than one bit, data from each source must be stored (buffered)
while other sources are using the channel. This storage will produce delay.

If the time slots are too large, then a significant delay will be introduced between each
source and its user.

[Link] Synchronous TDM


In the above discussion, each stream has predefined slot positions in the combined
stream, and the receiver must be aware which slots belong to which input stream. Both
transmission ends, the transmitter and the receiver, must be perfectly synchronized to
the slot period. For this reason, the technique is usually called ℎ .

[Link] Statistical TDM [Asynchronous TDM]


There is another version of TDM, called (also called ℎ
TDM). Statistical TDM is useful for applications in which the low-bit-rate streams have
speeds that vary in time.

For example, a low-bit-rate stream to a single terminal in a computer network may


fluctuate between 2 kbit/sec and 50 kbit/sec during an active connection session (for
example, variable Internet connection speed).

If we assign the stream enough slots for its peak rate (that is, for 50 kbit/sec), then we
will be wasting slots when the rate drops well below the peak value. This waste will be
high if the system has many variable-speed low-bit-rate streams.

Statistical TDM works by calculating the average transmission rates of the streams to
be combined, and then uses a high-speed multiplexing link with a transmission rate
that is equal to (or slightly greater than) the statistical average of the combined streams.
Since the transmission rates from each source are variable, we no longer assign a fixed
number of time slots to each data stream.

Rather, we dynamically assign the appropriate number of slots to accommodate the


current transmission rates from each stream. Since the combined rate of all the
streams will also fluctuate in time between two extreme values, we need to buffer the
output of the low-bit-rate streams when the combined rate exceeds the transmission
rate of the high-speed link.

[Link] TDP and TDMA


We can see the signal sent by different channels have been shown in a three
dimensional graph where the three dimensions are time, frequency and code. Also, we
can see the signals coming from different channels are only varying in terms of time.

It is possible to assign the slots to different stations or users dynamically (similar to


FDM). That means channel allocation can be done dynamically. If a particular channel
is statically allocated to a single station or user in that case we call it Time Division
Multiplexing.

If it is done dynamically based on demand then we call it time division multiple access.
That means a particular channel can be shared by a number of stations or users. We

5.5 Static Channelization Techniques 121


Elements of Computer Networking LAN Technologies

are dividing into different time slots and each of these time slots can be shared by more
than one station or user. That technique called TDMA or Time Division Multiple Access.

Code

Channel-n

Channel-2

Channel-1

Frequency

Time

If we have a number of channels, we can use the below equation to find the number of
channels that can be used.
×( × )
Number of channels, =

This is how we get the total number of channels that is possible in Time Division
Multiplexing.

[Link] Comparing FDM and TDM


FDM has both advantages and disadvantages relative to TDM. The main advantage is
that unlike TDM, FDM is not sensitive to propagation delays. Disadvantages of FDM
include the need for bandpass filters, which are relatively expensive. TDM, on the other
hand, uses relatively simple and less costly digital logic circuits.

5.5.3 Code Division Multiple Access [CDMA] Technique


As seen in previous sections, in TDMA and FDMA, the transmissions from different
stations are separated either in time or frequency. They are sent in different time slots
or from different stations where different frequencies are used.
In CDMA, multiple users share the same frequency band simultaneously. Each user
(station) has its own code words, which is approximately orthogonal to other code
words. This feature makes the system bandwidth efficient and no interference among
the stations. Because of unique assigned code station’s; data is secured.

Source Channel Multiple


Modulator Transmitter
Encoding Encoding Access

Through
Antenna

Source Channel Multiple


De- Receiver
Decoding Decoding Access
Modulator

Block diagram of CDMA system is shown in figure. Since the human speech is in the
analog signal, it has to be first converted into digital form. This function is performed by
5.5 Static Channelization Techniques 122
Elements of Computer Networking LAN Technologies

the source encoding module. After the source information is coded into a digital form,
redundancy needs to be added to this digital message or data. This is done to improve
performance of the communication system (due to noise).

[Link] Code Division Multiplexing


Code division multiplexing (CDM) takes signals from a set of sources at the same time
and sends in the same frequency band. This is done by using orthogonal codes (also
called , and ℎ - ) to spread each signal over a large frequency
band. At the receiver, an appropriate orthogonal code is used again to recover the signal
for a particular user.

Source-1 Data Source-1 Code Source-2 Data Source-2 Code

⊗ ⊗
Multipliers

(Source-1 Data × Source-1 Code) + (Source-2 Data × Source-2 Code)


+ (Source-3 Data × Source-3 Code) + Source-4 Data × Source-4 Code

Data
Common Channel

⊗ ⊗

Source-3 Code Source-3 Data Source-4 Code Source-4 Data

[Link] How does CDM works?


Let us walk through an example for understanding the working of CDM. Assume that
binary data is coming from four different sources: Station-1 ( ), Station-2 ( ), Station-
3 ( ), and Station-4 ( ). For simplicity, let us assume that 0 is represented by −1 and 1
is represented by +1. As shown in figure, 0 is coming from , 1 is coming from , 0 is
coming from , 1 is coming from and so on.
Data Bit 0  -1 Data Bit 0  -1 No Data (Silence)  0
Each of these stations is having an unique chip sequence (also called
and ℎ ). Chip sequence for is +1, +1, +1, +1 (essentially it is 1 1 1 1). On
the other hand, for it is +1, -1, +1, -1 and it is different from the chip sequence of
and then for the chip sequence is +1, +1, -1, -1 and again it is different either from
and . Finally, the chip sequence for is +1, -1, -1, +1. As we can see all these four
chip sequences are unique. Each of them is different from the other three and binary
input is multiplied with the chip sequences.

+1, +1, +1, +1 +1, -1, +1, -1 +1, +1, -1, -1 +1, -1, -1, +1
For , multiplying the chip sequence +1, +1, +1, +1 with -1 becomes -1, -1 -1, -1. On
the other hand, for multiplying +1 with +1, -1, +1 -1 becomes +1, -1, +1 -1. Then for
, multiplying -1 with the chip sequence +1, +1, -1, -1 becomes -1, -1, +1, +1. For , it

5.5 Static Channelization Techniques 123


Elements of Computer Networking LAN Technologies

is multiplied with +1. That means, multiplying +1 with the chip sequence +1, -1, -1, +1
becomes +1, -1, -1, +1.

Source-1 Code Source-2 Code


Data: -1 +1, +1, +1, +1 Data: +1 +1, -1, +1, -1

⊗ Multipliers ⊗

(-1) × (+1, +1, +1, +1) +


(+1) × ( +1, -1, +1, -1) +
(-1) × (+1, +1, -1, -1) +
(+1) × (+1, -1, -1, +1) = (0, -4, 0, 0)

Data
Common Channel

⊗ ⊗

Code Source-3 Code Source-4


+1, +1, -1, -1 Data: -1 +1, -1, -1, +1 Data: +1

Now these are added bit by bit and for the first bit we can see that sum of +1, -1, +1, -1
becomes 0. For the second bit, -1, -1, -1, -1 becomes -4 (we have to add all the four).
Similarly, for third bit -1, +1, +1, -1 it is 0 and for fourth bit –1, -1, +1, +1 it is 0.
Code
+1, +1, +1, +1

Input 0: -1 -1 ⊗ -1, -1, -1, -1

Source-1
Code
+1, -1, +1, -1

Input 1: +1 ⊗ +1, -1, +1, -1


0, -4, 0, 0
Source-2
Code
+1, +1, -1, -1 ⊕

Input 0: -1 -1 ⊗ -1, -1, +1, +1

Source-3
Code
+1, -1, -1, +1

Input 1: +1 ⊗ +1, -1, -1, +1

Source-4

The final composite signal corresponds to 0, -4, 0, 0 and this can be sent over the
medium. After it is received; the same chip sequences (which were used before
transmission) are used for demultiplexing.
5.5 Static Channelization Techniques 124
Elements of Computer Networking LAN Technologies

Code
+1, +1, +1, +1 Divide
with 4
⊗ 0, -4, 0, 0 -4 -1 0

Code
+1, -1, +1, -1 Divide
with 4
⊗ 0, +4, 0, +4 +1 0
0, -4, 0, 0
⊕ Code
+1, +1, -1, -1
Divide
with 4
⊗ 0, -4, 0, 0 -4 -1 0

Code
+1, -1, -1, +1 Divide
with 4
⊗ 0, +4, 0, +4 +1 1

Therefore, multiplying 0, -4, 0, 0 with chip sequences gives:


 0, -4, 0, 0 multiplying with +1, +1, +1, +1 becomes 0, -4, 0, 0
 0, -4, 0, 0 multiplying with +1, -1, +1, -1 becomes 0, +4, 0, 0
 0, -4, 0, 0 multiplying with +1, +1, -1, -1 becomes 0, -4, 0, 0
 0, -4, 0, 0 multiplying with +1, -1, -1, +1 becomes 0, +4, 0, 0
Now, we have to perform the addition.
 Sum of all numbers in 0, -4, 0, 0 gives -4
 Sum of all numbers in 0, +4, 0, 0 gives +4
 Sum of all numbers in 0, -4, 0, 0 gives -4
 Sum of all numbers in 0, +4, 0, 0 gives +4
Then, we divide the resultants with 4 (since the total number of channels is 4).
 Dividing -4 with 4 gives -1
 Dividing +4 with 4 gives +1
 Dividing -4 with 4 gives -1
 Dividing +4 with 4 gives +1
The final result is -1, +1, -1, +1. Since -1 is nothing but 0, +1 is nothing but 1; the
input transmitted data 0 1 0 1 is now recovered.

[Link] Selecting Spreading Code


If is the bit rate of data (from a source station) then spreading factor is selected such
that it occupies the entire frequency band of the medium. That means the number of
bits in chip sequence is chosen such that it occupies the entire bandwidth of the
channel. So it can be 8, it can be 16 or it can be 128 depending on the bandwidth of the
medium. Therefore, the signal that comes out becomes times; which are the number
of bits in the chip sequence divided with the data rate of the source.
After multiplying, this is the signal that is being generated and now we can perform
digital modulation (like QAM, QPSK kind of modulation) and then we can transmit by

5.5 Static Channelization Techniques 125


Elements of Computer Networking LAN Technologies

using an antenna. This is how the transmission is performed and as we can see the
bandwidth here is at times the bandwidth of each of the channels.
At the receiving end; signals from all the transmitters are being received by antenna
and then the composite signal is multiplied with the digital demodulator. After
demodulation we get the composite signal and that is multiplied with unique pseudo
random binary sequence. After multiplying with the same pseudo random sequence we
get the original signal back. Of course it will have some noise because of interference
and other problems but we get back the binary information.

[Link] Near-Far Problem


In the above discussion, we have assumed that the signals coming from different
stations have equal strength. Essentially the - problem arises; because if there
is a receiver which is receiving signal from a number of transmitters; depending on the
distance if it is very near then the signal strength coming from that signal will be very
high and the signal strength from the other signals will be low.
As a result, if the signal strength is very low then that will be ignored and will be
considered as 0. Similarly, if the signal strengths are not equal then the noise will
increase; that is, the interference will increase. In other words; the summation and the
subsequent deduction is based on the assumption that they are of equal strength.
That’s why; some kind of power control mechanism is used at each of the transmitter to
overcome the - problem as it is used in cellular telephone network.

[Link] Characteristics of Spreading Codes [Chip Sequences]


Let’s now understand the pseudo-random chip sequence in detail. As discussed, each
station is assigned with an unique -bit code called ℎ . This is done by using
ℎ register. You may recall that, in error detection using cyclic
redundancy code (CRC), to generate cyclic redundancy code and also to check it; we
used linear feedback shift register to generate a random sequence. That kind of linear
feedback shift register can also be used here to generate those unique pseudo random
binary sequences. These unique pseudo random sequences are used in transmitter as
well as in receiver.
As mentioned earlier, we want each bit in the chip sequence to be , ,
and (to ensure equal number of 0’s and 1’s in chip sequence). These
characteristics are achieved if the code exhibits the following three properties:
1. : The difference between the number of 1’s and 0’s should be either zero
or one.
2. : Among the groups of 1’s and 0’s in the chip sequence, half the
groups of each type should be one bit long, one fourth of the groups of each
type should be two bits long, one eighth of the groups of each type should be
three bits long, etc. The run property is an important indicator that the bits are
random and independent.
3. : Consider a -bit binary sequence … . We can write this
binary sequence in matrix form as
[ ]=[ … ]
Now consider a second -bit sequence, say, … . Again, we can write this
binary sequence in matrix form as
[ ]=[ … ]
We can use matrix notation to signify a bit-by-bit ⊕ (exclusive-or operation) of
the two sequences:
[ ]⊕[ ] =[ ⊕ ⊕ ⊕ ⊕ … ⊕ ]

5.5 Static Channelization Techniques 126


Elements of Computer Networking LAN Technologies

Let's consider one other operation—a cyclic shift. Let the notation [ ] indicates
the sequence of bits [ ] cyclically shifted places to the right. For example,
[ ]=[ … ]
[ ] =[ … ]
[ ] = …
The third desirable property of a chip sequence is that the -bit sequence
produced by [ ] ⊕ [ ] should exhibit balance for all non-zero values of less
than (the number of 1’s in [ ] ⊕ [ ] should differ from the number of 0’s by
no more than one for any value 1 ≤ j ≤ – 1).
Why does the property help ensure and ?
Since ⊕ of two bits produces a if both bits are the same (if both bits are 0’s or if
both bits are 1’s) and produces a if the two bits are different (if one of the bits is 0
and the other is 1). If a sequence of bits is truly random and independent, then
cyclically shifting the sequence by an arbitrary number of places; performing a bit-by-
bit comparison of the original; and shifted sequences should produce the same number
of agreements (the values of the two bits are the same) as disagreements (the values of
the two bits are different). Of course, if the sequence contains an odd number of bits,
the number of agreements and disagreements will have to differ by at least one.

[Link] Generating Chip Sequences


Chip sequences are not randomly chosen sequences. We do not generate them in an
arbitrary manner. Generating them in an arbitrary manner will make the property of
orthogonality not satisfied.
Let us use the symbol to indicate the -bit sequence code for station and is the
complement of . The chip sequences of all the stations are pair-wise orthogonal. That
means; the normalized inner product of any two different codes will be 0. For example,
is having the code +1, -1, +1, -1 and ′s code is equal to +1, +1, -1, -1.
chip sequence chip sequence
+1, -1, +1, -1 +1, +1, -1, -1
If we take the inner product of these two, which means multiplying +1 with +1 (first two
bits) will give +1. Similarly, +1 with -1 will give -1, -1 with +1 gives -1, and -1 with -1
gives +1. Then, adding them will give us 0.
.
+1 +1 +1
-1 +1 -1
+1 -1 -1
-1 -1 +1
Sum=0
This is valid for any two distinct codes. That means;
. =0
. =0
. =0
On the other hand, multiplying the same code, say . , would give us 1.
.
+1 +1 +1
-1 -1 +1
+1 +1 +1
-1 -1 +1
Sum = 4
and 4/4 = 1

5.5 Static Channelization Techniques 127


Elements of Computer Networking LAN Technologies

As shown above, adding them would give 4 and dividing the result with number of bits
gives 1. So, we found that multiplying same chip sequences would give 1. Also, if we
multiply with the complement then we get 0. That means;
. =1
. = 0; if ≠
. =0
This is the ℎ property that is to be satisfied by the chip sequences, only then
the multiplexing and demultiplexing is possible. In other words transmission and
subsequent recovery at the receiving end is possible only when this ℎ property
is satisfied.

[Link].1 Walsh Table


Now, let us concentrate on how the chip sequences are generated. What is the
technique used to generate the chip sequences?
Chip sequences have to be pair-wise orthogonal. That can be done by using Walsh table
in an interactive manner. That means, ℎ table can be used to generate orthogonal
sequences in an interactive manner. Note that, number of sequences is always a power
of two.
is +1 and is a one dimensional matrix; is a two dimensional matrix with four
entries.
= [+1] =

From the above representation, we can compute from .

For example, is +1 and to get , we have substituted , , and . That


means, +1 +1 +1 and -1 then , can be generated from . This is how it is being done.
+1 +1 +1 +1 +1 +1 +1 +1
⎡ ⎤
⎢+1 −1 +1 −1 +1 −1 +1 −1⎥
+1 +1 +1 +1 ⎢+1 +1 −1 −1 +1 +1 −1 −1⎥
+1 +1 ⎢ +1 −1 −1 +1⎥
= [+1] = = +1 −1 +1 −1 = = ⎢+1 −1 −1 +1
+1 −1 +1 +1 −1 −1 +1 +1 +1 +1 −1 −1 −1 −1 ⎥
⎢ ⎥
+1 −1 −1 +1 ⎢ +1 −1 +1 −1 −1 +1 −1 +1 ⎥
⎢ +1 +1 −1 −1 −1 −1 +1 ∓1 ⎥
⎣ +1 −1 −1 +1 −1 +1 +1 −1 ⎦
This way, we can generate the next bit sequences in an interactive manner. So, if the
table for sequences is known the table for 2 sequences can be created and it can be
proved that these sequences satisfy the orthogonal property.

5.6 LocalTalk
LocalTalk is a network protocol developed by for ℎ computers. Older
computers can be connected through a serial port with special twisted pair cable and
adapters. The main disadvantage of LocalTalk is the speed (230 Kbps).
Although LocalTalk networks are slow, they are popular because they are easy and
inexpensive to install and maintain.

5.7 Ethernet
The most popular set of protocols for the Physical and Data Link layers is Ethernet.
Ethernet operates at the first two layers of the OSI model: Physical and Data Link
layers. Initially, Ethernet was given a name ℎ . Ethernet was created by
(in 1973). Metcalfe thought the name ℎ suitable because the cable
used to build a network is a passive medium that permits the propagation of data.
5.6 LocalTalk 128
Elements of Computer Networking LAN Technologies

The cost of an Ethernet port on a node is very low compared to other technologies.
Many vendors build Ethernet into the motherboard of the computer so that it is not
necessary to purchase a separate NIC.
In Ethernet, both the data link and the physical layers are involved in the creation and
transmission of frames. The physical layer is related to the type of LAN cabling and how
the bits are transmitted and received on the cable. Ethernet divides the Data Link layer
into two separate layers:
 Logical Link Control (LLC) layer
 Medium Access Control (MAC) layer

The MAC sublayer address is the physical hardware address of the source and
destination computer. All devices on a LAN must be identified by a unique MAC
address. This sublayer controls which computer devices send and receive the data and
allows NICs to communicate with the physical layer. The next level of processing is the
LLC sublayer. It is responsible for identifying and passing data to the network layer
protocol.

5.7.1 How Ethernet Works?


Ethernet uses a protocol called CSMA/CD (Carrier Sense Multiple Access with Collision
Detect). When one computer wanted to transmit, it would first check to see if any other
machines were using the line. If the line was free, the sending computer tags the data it
needed to send with a MAC (Media Access Control) address and loads it onto the
network.
The MAC address identifies the intended recipient so that the machine possessing that
unique MAC address would accept the data and all the other machines on the network
would ignore it.
If the transmission line was busy, the computer would wait. If two machines try to send
at the same time, each would react to the collision by waiting a random number of
milliseconds before attempting to resend.
The process was simple, but it was also very limited. Multiple collisions could quickly
reduce the performance of a large network. For example, it is easy to eavesdrop on the
network’s traffic with a fake MAC address. The network wasn’t very robust. Damage to
any cable in the network could cause the entire system down.

5.7.2 Ethernet and IEEE 802.3


Companies DEC, Intel, and Xerox created Version 2.0 of the Ethernet specification in
1982. Version 2.0 formed the basis for 802.3 standard. Although there are some minor
differences between the two technologies, the terms Ethernet and 802.3 are generally
used synonymously.
In reality, at the physical layer, 802.3 is the standard and at data link layer, both
Ethernet Version 2.0 and 802.3 implementations are common.
: One important difference between Ethernet Version 2.0 and 802.3 is frame
formats.

5.7.3 Ethernet Technology Choices


The following options for implementing Ethernet networks are available:
 Half- and full-duplex Ethernet
 10-Mbps Ethernet
 100-Mbps Ethernet
5.7 Ethernet 129
Elements of Computer Networking LAN Technologies

 1000-Mbps (1-Gbps or Gigabit) Ethernet


 10-Gbps Ethernet

Logical Link Control (LLC)


Data Link Layer

Medium Access Control (MAC)

ℎ :
ℎ : ℎ :

10Base5 100BaseT 1000BaseT


Physical Layer 10Base2 100BaseFX 1000BaseTX
10BaseT 100BaseSX 1000BaseFX
10BaseFX 100BaseBX 1000BaseSX
1000BaseBX

For example, 10BaseT Ethernet protocol uses 10 for the speed of transmission at 10
megabits per second [Mbps], the for [means it has full control of the wire
on a single frequency], and the for cable.
ℎ :
100BaseT 100 Mbps over Twisted-pair category 5
100BaseFX 100 Mbps over fiber optic cable
100BaseSX 100 Mbps over multimode fiber optic cable
100BaseBX 100 Mbps over single mode fiber cable

ℎ :
1000BaseT 1000 Mbps over 2-pair category 5
1000BaseTX 1000 Mbps over 2-pair category 6
1000BaseFX 1000 Mbps over fiber optic cable
1000BaseSX 1000 Mbps over multimode fiber cable
1000BaseBX 1000 Mbps over single mode fiber cable

The choice of an Ethernet technology depends on parameters like: location and size of
user communities, bandwidth, and QoS requirements.

[Link] Half-Duplex and Full-Duplex Ethernet


The initial definition of Ethernet was for a shared medium with stations using the
carrier sense multiple access/collision detection (CSMA/CD). CSMA/CD algorithm
regulates the sending of frames, detects collisions when two nodes send at the same
time.
With shared Ethernet, a station listens before it sends data. If the medium is already in
use, the station defers its transmission until the medium is free. Shared Ethernet is
ℎ , meaning that a station is either transmitting or receiving traffic, but not
both at once.
A point-to-point Ethernet link which supports simultaneous transmitting and receiving
is called - ℎ . On a link between a switch port and a single station, for
example, both the switch and the station can transmit at the same time.
This is beneficial if the station is a server that processes queries from many users. The
switch can transmit the next query at the same time the server is sending a response to

5.7 Ethernet 130


Elements of Computer Networking LAN Technologies

a previous query. The advantage of full-duplex Ethernet is that the transmission rate is
theoretically double what it is on a half-duplex link.
Full-duplex operation requires the cabling to dedicate one wire pair for transmitting and
another for receiving. Full-duplex operation does not work on cables with only one path
(for example, coaxial cable).

[Link] 10-Mbps Ethernet


Although 100-Mbps Ethernet is beginning to replace 10-Mbps Ethernet, 10-Mbps
Ethernet can still play a role in your network design, particularly at the access layer.
For some customers 10-Mbps capacity is sufficient. For customers who have low
bandwidth needs and a small budget, 10-Mbps Ethernet is an appropriate solution if
the network does not need to scale to 100-Mbps in the near future.
Many business applications do not benefit just with an upgrade to 100-Mbps Ethernet.
Inefficient applications that send many small frames generate more collisions on 100-
Mbps Ethernet and that decreases the throughput.
10BASE5 10BASE2 10BASE-T
Topology Bus Bus Star
Type of cabling Thick coax Thin coax UTP
Maximum cable 100 from hub to
500 185
length (in meters) station
Maximum number
2 (hub and station or
of attachments per 100 30
hub and hub)
cable
Maximum collision
2500 2500 2500
domain (in meters)
5 segments, 4 5 segments, 4 5 segments, 4
Maximum topology
repeaters, only 3 repeaters, only 3 repeaters, only 3
of a collision
segments can have segments can have segments can have
domain
end systems end systems end systems

10BASE-
10BASE-FB 10BASE-FL Old FOIRL
FP
Backbone or
Repeater- Repeater-
Topology Star repeater
repeater link repeater link
system
Maximum cable
500 2000 2000 1000
length (in meters)
Allows end system
Yes No No No
connections?
Allows cascaded
No Yes No No
repeaters?
Maximum collision
2500 2500 2500 2500
domain (in meters)

[Link] 100-Mbps Ethernet


100-Mbps Ethernet (also called Fast Ethernet and 100BASE-T Ethernet), was initially
standardized in IEEE 802.3u specification and is now merged into the 2002 edition of
IEEE 802.3. It is very similar to 10-Mbps Ethernet. With some exceptions, 100-Mbps
Ethernet is simply standard Ethernet, just 10 times faster.
In most cases, design parameters for 100-Mbps Ethernet are the same as 10-Mbps
Ethernet, just multiplied or divided by 10.

5.7 Ethernet 131


Elements of Computer Networking LAN Technologies

[Link] Gigabit Ethernet


Gigabit Ethernet was initially defined in IEEE 802.3z specification and is now merged
into the 2002 edition of IEEE 802.3. It operates essentially like 100-Mbps Ethernet,
except that it is 10 times faster. It uses a standard 802.3 frame format and frame size.

[Link] 10-Gbps Ethernet


One of the reasons that Ethernet is such a good choice for campus network designs is
that it continues to grow with increasing bandwidth demands. In 2002, the IEEE
standardized 10-Gbps Ethernet in the 802.3ae specification. The frame format of 10-
Gbps Ethernet is same. This means that applications that use Ethernet do not need to
change.

5.7.4 Ethernet Frames


As discussed earlier, in Ethernet, both the data link and the physical layers are involved
in the creation and transmission of frames. The physical layer is related to the type of
LAN cabling and how the bits are transmitted and received on the cable. The data link
layer is divided into sublayers, the Logical Link Control (LLC) and the Media Access
Control layers (MAC).
The MAC sublayer address is the physical hardware address of the source and
destination computer. The next level of processing is the LLC sublayer. It is responsible
for identifying and passing data to the network layer protocol.
Initially, companies DEC, Intel and XEROX created the DIX standard and defined DIX
frame (also called Ethernet II). Later, Institute of Electrical and Electronics Engineers
[IEEE] defined the IEEE 802.3 specification and defined IEEE 802.3 frames. There is a
slight change in these two frame formats.

[Link] DIX Frame (Ethernet II) Format


Frame
Destination Source
Preamble Type Data Check
Address Address
Sequence

Preamble DA SA Type Data FCS


8 6 6 2 46-1500 4

Size in Bytes
Frame field Description
Indicates the start of a new frame and establishes
synchronization conditions between devices. The last byte, or
Preamble
start frame delimiter, always has a 10101011-bit pattern. This
byte indicates the start of a frame.
Destination Address The Destination Address is the hardware (MAC) address of the
(DA) receiving device.
Source Address (SA) Specifies the hardware (MAC) address of the sending device.
The Type field specifies the network layer protocol used to send
Type
the frame, for example TCP/IP.
The Data field is for the actual data being transmitted from
Data device to device. It also contains information used by the
network layer and indicates the type of connection.
Frame Check Sequence Contains CRC error-checking information.

5.7 Ethernet 132


Elements of Computer Networking LAN Technologies

[Link] IEEE 802.3 Frame Format


Start Frame
Destination Source Data and
Preamble Frame Length Check
Address Address Padding
Delimiter Sequence
Preamble SFD DA SA Length Data/Pad FCS
7 1 6 6 2 46-1500 4

Size in Bytes
Frame field Description
Indicates the start of a new frame and establishes
synchronization conditions between devices. The last byte, or
Preamble
start frame delimiter, always has a 10101011-bit pattern. This
byte indicates the start of a frame (same as DIX frame).
The Start Frame Delimiter (SFD) has the same 10101011-bit
sequence found at the end of the DIX preamble. Both formats
Start Frame Delimiter
use the same number of bytes to perform the synchronization
of the signals.
The Destination address can be either 2 or 6 bytes. Whether 2
Destination Address or 6 bytes are used, all devices within the same network must
(DA) use the same format. IEEE protocols specify that a 10Mbs
network must use 6 bytes. The 2 byte length is obsolete.
Source Address (SA) Same as DA.
The Length field indicates the number of bytes in the data
field. If the data field is less than the required 46 bytes, a pad
Length
field is added to the data frame. The bytes added for padding
purposes are usually zeros.
The Data field is for the actual data being transmitted from
Data and Padding device to device. It also contains information used by the
network layer and indicates the type of connection.
Frame Check Sequence Contains CRC error-checking information (same as DIX frame).
It should be noted that if one device uses an IEEE 802.3 NIC and the other device uses a DIX
Ethernet NIC, they would not be able to communicate with one another. Devices must create the
same Ethernet frame format in order to be compatible. One way to tell them apart is that the DIX
frame has a field, which defines the protocol used for the frame, and IEEE 802.3 has a ℎ
field in its place. IEEE 802.3 also has additional fields not used with the DIX format.

[Link] IEEE 802.2 LLC Format


In between the length field and the data/pad field, is the 802.2 LLC field.
Frame
Destination Source
Preamble Type Data Check
Address Address
Sequence
Preamble DA SA Type Data FCS
8 46-
6 6 2 4
1500

Destination Service Source Service


Control
Access Protocol Access Protocol

DSAP SSAP Control


1 1 1

Size in Bytes

5.7 Ethernet 133


Elements of Computer Networking LAN Technologies

Frame field Description


Destination Service It is the protocol processing layer the
Access Protocol data is to be sent to.
Source Service Access It is the protocol used to encapsulate
Protocol the data at the source.
It is the field that defines the type of
Control
LLC frame this is.

[Link] SNAP Format of 802.2


SNAP (Sub-Network Access Protocol) was created by the IEEE to identify the Network
layer protocol used. The original Ethernet version 2.0 field had been reused as a
ℎ field by the IEEE when creating the IEEE 802.3 standard.
SNAP was defined to enable this Length field to remain while also allowing the vendor
and protocol to be defined in the first 40 bits of the Data field. Together, these two fields
(Organization and EtherType) are called .

Destination Service Source Service


Control Organization EtherType
Access Protocol Access Protocol

DSAP (AA) SSAP (AA) Control Organization EtherType


1 1 1 3 2

Size in Bytes

Frame field Description


Destination Service AA in the DSAP fields indicates that the LLC field is using
Access Protocol (AA) SNAP format.
Source Service Access AA in the SSAP fields indicates that the LLC field is using
Protocol (AA) SNAP format.
Control It is the field that defines the type of LLC frame this is.
Organization is the field that indicates which organization
Organization created the protocol identified in the EtherType field, though
generally this is coded as all zeros by most organizations.
EtherType is a two-byte identifier for the protocol being used to
EtherType encapsulate the data. For example, IP is indicated by the code
0x08-00 and ARP by 0x08-06.
Control It is the field that defines the type of LLC frame this is.

[Link] Frame Types


There are three types of frames and each has a different purpose.
 Unicast frames
 Multicast frames
 Broadcast frames
If the first bit of the frame is 0, it is Unicast; if it is 1, it is multicast. Broadcast frames
always have 1 as the second bit.
A frame is addressed to a single network device. This means that the frame is to
be read only by the device that matches the destination address. All other devices will
receive a copy of the frame but will discard it because it does not match their
destination address. The address used is the MAC of the network device.
A frame is addressed to several but not all devices. All devices that are a part
of the specified group may read the frame. A multicast address is a deviation from the
normal hardware address. For example, a group of devices are assigned access to a

5.7 Ethernet 134


Elements of Computer Networking LAN Technologies

particular server on the network. They are the only devices that receive frames
announcing the availability of that server. Any device that does not belong to this group
will ignore or discard these frames.
A frame is addressed for all network devices to read and process. A broadcast
address is a unique address used only for broadcast frames. It is not a hardware
address. Broadcast frames are transmitted across bridges and switches; but, routers
will stop broadcast frames.

5.7.5 Physical Devices for an Ethernet network


There are three main pieces of Ethernet hardware:
1. Ethernet cards [also called Adapters, Network Interface cards]
2. Ethernet cables
3. Ethernet routers and hubs
A Network Interface Card (NIC) is a device that allows computers to be joined together
in a LAN network. An Ethernet network interface card is installed in an available slot
inside the computer, typically on the ℎ . The NIC assigns a unique Media
Access Control (MAC) address to the machine, which is used to direct traffic between
the computers on a network.
Ethernet cables have a number of styles [refer ℎ ℎ ℎ section].
Ethernet hubs and Ethernet routers are like dispatchers in an Ethernet network
because they direct data to the correct recipient. Hubs and routers can be connected to
other devices, not only to computers and depending on the way they are connected,
there are different Ethernet topologies.

5.8 Token Ring


Token ring local area network (LAN) technology is a local area network protocol and it
resides at the data link layer (DLL) of the OSI model.
It was developed by IBM (in 19970s) and was a popular technology used in LANs (before
Ethernet). Today it is difficult to find token ring based networks because the cost and
flexibility of ℎ came to dominate the market. The goal of Token Ring was to
provide a simple wiring structure (say, using twisted-pair cable) that connects a
computer to the network.
The related IEEE 802.5 specification is almost identical and completely compatible with
IBM's Token Ring network implementations. The IEEE 802.5 specification was
developed after IBM's Token Ring specification.
As its name indicates, nodes (computers) are arranged in a ring and single token is
continuously passed from computer to computer.

2. Computers not holding


the token passes bits

3. Destination makes a
1. Sender holding token
copy of data and passes
sends bits of frame

4. Sender receives
bits of frame

5.8 Token Ring 135


Elements of Computer Networking LAN Technologies

When a computer wants to send data to another computer, it waits for the token to
come around and then attaches its data to it. The token is then passed to the next
computer in the ring until it reaches the recipient computer. The recipient attaches two
bits of data to the token to inform the sender that the data was received. Other
computers can't send data until the ring is free again.

5.8.1 How it works?


3 2

4 1

Free Token

5 6

At the start, an empty information frames are continuously circulated on the ring. To
use the network, a machine first has to capture the free Token and replace the data
with its own message.

3 2

Data Frame

4 1

5 6

In the example above, machine 1 wants to send some data to machine 4, so it first has
to capture the free Token. It then writes its data and the recipient's address onto the
Token.

3 2
Data Frame

4 1

5 6

5.8 Token Ring 136


Elements of Computer Networking LAN Technologies

The packet of data is then sent to machine 2 who reads the address, realizes it is not its
own, so passes it on to machine 3.

3 2

Data Frame

4 1

5 6

Machine 3 does the same and passes the Token on to machine 4.

3 2

4 1

Data Frame

5 6

This time it is the correct address and so machine 4 reads the message. It cannot,
however, release a free Token on to the ring; it must first send the frame back to
machine 1 with an acknowledgement to say that it has received the data.

3 2

4 1

Data Frame

5 6

The receipt is then sent to machine 5 who checks the address, realizes that it is not its
own and so forwards it on to the next machine in the ring, machine 6.
Machine 6 does the same and forwards the data to machine 1, who sent the original
message.
Machine 1 recognizes the address, reads the acknowledgement from number 4 and then
releases the free Token back on to the ring ready for the next machine to use.

5.8 Token Ring 137


Elements of Computer Networking LAN Technologies

3 2

4 1

Data Frame

5 6

In summary, here is how it works:


1. Empty information frames are continuously circulated on the ring.
2. When a machine has a message to send, it inserts a token in an empty frame
(this may consist of simply changing a 0 to a 1 in the token bit part of the
frame) and inserts a message and a destination identifier in the frame.
3. The frame is then examined by each successive machine. If the workstation
sees that it is the destination for the message, it copies the message from the
frame and changes the token back to 0.
4. When the frame gets back to the originator, it sees that the token has been
changed to 0 and that the message has been copied and received. It removes
the message from the frame.
5. The frame continues to circulate as an frame, ready to be taken by a
machine when it has a message to send.

5.8.2 Token Ring with Hub


The architecture of a typical Token Ring network begins with a physical ring but it is
not compulsory. In IBM implementation, a star-wired ring, computers on the network
are connected to a central hub. The logical ring represents the token's path between
computers. The actual physical ring of cable is in the hub. Machines are part of a ring,
but they connect to it through a hub.

Hub

The Token still circulates around the network and is still controlled in the same
manner. Using a hub or a switch greatly improves reliability because the hub can
automatically bypass any ports that are disconnected or have a cabling fault.

5.8 Token Ring 138


Elements of Computer Networking LAN Technologies

5.8.3 Token and Data Frames


The basic transmission unit on Token-Ring is a frame. In simple terms, token frame in
a token ring network is a 3-bit piece of data that constantly travels around the network.
When a node (machine) indicates that it is ready to transmit data it converts the token
frame to a data frame.
This data frame is then transmitted around the network until it reaches the receiving
node, which once again converts it back into a token frame.
Token Ring and IEEE 802.5 support two basic frame types: tokens and data/command
frames. Data/Command frames) vary in size, depending on the size of the Information
field (which contains the data to be transmitted).
Data frames carry information for upper-layer protocols and command frames contain
control information and have no data for upper-layer protocols.

[Link] Token Frame


Tokens are 3 bytes in length and consist of a start delimiter, an access control byte, and
an end delimiter.
Starting Delimiter Access Control Ending Delimiter
SD AC ED
1 1 1

Size in Bytes

Frame field Description


Start Delimiter Indicates start of the frame.
Indicates the frame's priority and whether it is a token or a
Access Control
data frame
End Delimiter Indicates the end of the frame
(SD) indicates the arrival of a frame or token. This field includes bits that
are set to intentionally violate the Differential Manchester Code to distinguish this field
as a delimiter. This byte is coded as JK0JK000, where the J and K bits are intentional
Manchester encoding violations. These intentional violations delineate the token from
normal traffic data. J is the encoding violation of a 1, and K is the encoding violation of
a 0.
(AC) byte is coded as . The priority bits (PPP) provide eight
levels of priority (000 through 111). The token indicator bit (T) of 0 determines that the
following information is a token, a 1 designates the following information is a frame.
The bit (M) is used to prevent frames from constantly circling the ring. The
Priority Reservations bits (RRR) provide token reservation to ring stations.
(ED) byte is coded as JK1JK1IE, where the J and K bits are encoding
violations and the I and E bits are the intermediate frame and error detection bits,
respectively. The intermediate bit is set to 1 if there are more frames to transmit in this
set. The error detection bit is set to 1 by a station that recognizes a CRC error in the
frame so other stations downstream do not report the same error.

[Link] Data/Command Frame


Frame
Starting Access Frame Destination Source Ending Frame
Data Check
Delimiter Control Control Address Address Delimiter Status
Sequence
SD AC FC DA SA Data FCS ED FS
1 1 1 6 6 >=0 4 1 2

Size in Bytes

5.8 Token Ring 139


Elements of Computer Networking LAN Technologies

Frame field Description


Start Delimiter Indicates start of the frame
Indicates the frame's priority and whether it is a token or a
Access Control
data frame
Contains either Media Access Control information for all
Frame Control
computers or information for only one computer
Destination Address Indicates the address of the computer to receive the frame
Source Address Indicates the computer that sent the frame
Information, or data Contains the data being sent
Frame Check Sequence Contains CRC error-checking information
End Delimiter Indicates the end of the frame
Tells whether the frame was recognized, copied, or whether the
Frame Status
destination address was available

(SD) - Same as Token Frame.


Control (AC) - Same as Token Frame.
(FC) field consists of eight bits, coded as TT00AAAA. The Frame Type bits
(T) indicate the frame type. Bits 2 and 3 are reserved, and are always zero. Bits four
through eight are Attention Codes which provide the token ring adapter of incoming
MAC information that can be copied to a special Express Buffer in the token ring
adapter.
(DA) indicates the station which need to receive the frame. The
Destination Address can be sent to a specific station, or a group of stations.
(SA): The Source Address is the MAC address of the sending station.
: A MAC frame field contains token ring management information, and a non-
MAC (LLC) data field contains user data.
ℎ (FCS): A 32 bit Cyclical Redundancy Check (CRC) is performed on
the frame data to provide an integrity check of the frame data. As each station copies
the frame, the CRC is computed and compared with the value in the FCS frame to verify
that the frame data is correct.
(ED) - Same as Token Frame.
(FS) field provides information for the sending station regarding the status
of the frame as it circulates the ring. The Frame Status field is coded as AF00AF00. The
bits of the Frame Status field are duplicated, since this field does not fall under the CRC
checking of the Frame Check Sequence bytes.
The Address Recognized Indicator (ARI) is set to 1 by the destination station if the
destination station recognizes the frame. The Frame Copied Indicator (FCI) is set to 1 if
the destination station was able to copy the frame into the local adapter buffer memory.

5.8.4 Token Ring Self Maintenance


When a Token Ring network starts up, the machines all take part in a negotiation to
decide who will control the ring, or become the to give it its proper title.
This is won by the machine with the highest MAC address who is participating in the
contention procedure, and all other machines become .
The job of the is to make sure that none of the machines are causing
problems on the network, and to re-establish the ring after a break or an error has
occurred. There can only be a single active monitor on a physical token ring. The
performs ring every seconds and resets the ring when there
appears to be a problem. The ring polling allows all machines on the network to find out

5.8 Token Ring 140


Elements of Computer Networking LAN Technologies

who is participating in the ring and to learn the address of their


ℎ (NAUN).
Ring reset is performed after an interruption or loss of data is reported. Each machine
knows the address of its NAUN. This is an important function in a Token Ring as it
updates the information required to re-establish itself when machines enter or leave the
ring.
When a machine enters the ring it performs a test to verify that its own connection is
working properly, if it passes, it sends a voltage to the hub which operates a relay to
insert it into the ring. If a problem occurs anywhere on the ring, the machine that is
immediately after the fault will stop receiving signals. If this situation continues for a
short period of time; it initiates a recovery procedure which assumes that its NAUN is at
fault, the outcome of this procedure either removes its neighbor from the ring or it
removes itself.
If the is removed from the ring or no longer performs the
functions, one of the on the ring will take over as .

5.8.5 Token Insertion Choices: Operational Modes


When a station has data to transmit, the station captures the token and produces a
modified token as the header for the packet to indicate to other stations that the ring is
no longer free. The amount of data in the packet can be arbitrary. The transmitting
station is responsible for removing its packet from the ring and for generating a new
free token when its transmission is over. There are several times when a new free token
can be generated. The variations are: multiple-token, single-token, and single-packet
operation.

[Link] Multiple-Token
In multiple-token mode, the transmitting machine generates a new free token and
places it on the ring immediately following the last bit of transmitting data. This type of
operation allows several busy tokens and one free token on the ring at the same time.

[Link] Single-Token
Single-token operation requires that a transmitting machine wait until it has cleared its
own busy token before generating a new free token. If a packet is longer than the ring
latency, however, the machine will receive (and erase) its busy token before it has
finished transmitting data.
In this case, the machine must continue transmitting data and generate a new free
token only after the last data bit has been transmitted. This is the same as multiple-
token operation. Thus single-token and multiple-token operation differ only in cases for
which the packet is shorted than the ring latency.

[Link] Single-Packet
For single-packet operation, a machine does not issue a new free token until after it has
circulated completely around the ring and erased its entire transmitted packet. This
type of operation is the most conservative of the three in ensuring that two
transmissions do not interfere.
Both single-packet and single-token operation ensure that there is only a single token
on the ring at any given time, but the difference is that single-packet operation requires
that the complete packet be cleared before generating a new free token.

5.8.6 Physical devices for a Token Ring Network


Token ring connectivity needs three separate devices.
5.8 Token Ring 141
Elements of Computer Networking LAN Technologies

( ): A MAU is a hub-like device that connects to all token


ring stations. Although the token ring stations are attached to the MAU in a physical
star topology, a true ring is maintained inside the MAU.
Unlike an Ethernet hub, a MAU consists of physical or electronic relays which keep
each station in a loopback state until a voltage is sent from the station to the MAU.
Since this voltage does not affect data communications, it is called ℎ voltage.
Once this phantom voltage is received by the MAU, a relay is activated and that inserts
the token ring station onto the ring.
: A token ring lobe cable connects the token ring station to the
MAU. This cable communicates over four wires; two for transmit and two for receive.
The cable can be Shielded Twisted Pair (STP) or Unshielded Twisted Pair (UTP).
: A token ring adapter card is the physical interface that a
station uses to connect to a token ring network. There are token ring adapter cards for
almost every computer bus type.

5.8.7 Process for a Machine to Insert into the Token Ring


The process for a machine to insert into the Token Ring has following five phases:
 Phase 0—Lobe media check
 Phase 1—Physical insertion
 Phase 2—Address verification
 Phase 3—Participation in ring poll
 Phase 4—Request initialization

Phase 0—Lobe media check


The insertion process begins with a lobe test. This phase actually tests the transmitter
and receiver of the Token Ring adapter and tests the cable between the adapter and the
MAU. An MAU physically wraps the connection cables transmit wire back to its receive
wire.
The effect is that the adapter can transmit media test MAC frames up the cable to the
MAU (where it is wrapped) and back to itself. During this phase, the adapter sends lobe
media test MAC frames to destination address 00-00-00-00-00-00 (with the source
address of the adapter) and a Duplication Address Test (DAT) MAC frame (which
contains the address of the adapter as both the source and destination) up the cable. If
the lobe test passes, then phase one is complete.

Phase 1—Physical insertion


In phase two, a phantom current is sent to open the hub relay, once the hub relay
opens the station and attaches itself to the ring. The station then checks to see if an
active monitor (AM) is present by checking for any of these frames:
 Active monitor present (AMP) MAC frame
 Standby monitor present (SMP) MAC frame
 Ring purge MAC frames
If none of these frames are detected within 18 seconds, the station assumes that there
is no active monitor present and it initiates the monitor contention process. Through
the monitor contention process, the station with the highest MAC address becomes the
active monitor. If contention is not completed within one second, the adapter fails to
open. If the adapter becomes the AM and initiates a purge, and the purge process does
not complete within one second, then the adapter fails to open. If the adapter receives a
beacon MAC frame or a remove station MAC frame, then the adapter fails to open.

5.8 Token Ring 142


Elements of Computer Networking LAN Technologies

Phase 2—Address verification


As part of the duplicate address check phase, the station transmits a series of duplicate
address MAC frames addressed to itself. If the station receives two frames back with the
Address Recognized Indicator (ARI) and Frame Copied Indicator (FCI) set to 1, then it
knows that this address is a duplicate on this ring, it detaches itself, and it reports a
failure to open.
This is necessary because Token Ring allows Locally Administered Addresses (LAAs),
and you could end up with two adapters with the same MAC address if this check is not
done. If this phase does not complete within 18 seconds, the station reports a failure
and detaches itself from the ring.
Note: If there is a duplicate MAC address on another ring, which is permissible in
source-route bridged Token Ring networks, this will not be detected. The duplicate
address check is only locally significant.

Phase 3—Participation in ring poll


In the ring poll phase, the station learns the address of its NAUN (Nearest Active
Upstream Neighbor) and makes its address known to its nearest downstream neighbor.
This process creates the ring map. The station must wait until it receives an AMP or
SMP frame with the ARI and FCI bits set to 0. When it does, the station flips both bits
(ARI and FCI) to 1, if enough resources are available, and queues an SMP frame for
transmission.
If no such frames are received within 18 seconds, then the station reports a failure to
open and de-inserts from the ring. If the station successfully participates in a ring poll,
it proceeds into the final phase of insertion, request initialization.

Phase 4—Request initialization


In the request initialization phase, the station sends four request initialization MAC
frames to the functional address of the Ring Parameter Server (RPS). If there is no RPS
present on the ring, the adapter uses its own default values and reports successful
completion of the insertion process. If the adapter receives one of its four request
initialization MAC frames back with the ARI and FCI bits set to 1, it waits two seconds
for a response. If there is no response, it retransmits up to four times. At this time, if
there is no response, it reports a request initialization failure and de-inserts from the
ring.
This is a list of the functional addresses:
C000.0000.0001 Active monitor
C000.0000.0002 Ring Parameter Server
C000.0000.0004 Network Server Heartbeat
C000.0000.0008 Ring Error Monitor
C000.0000.0010 Configuration Report Server
C000.0000.0020 Synchronous Bandwidth Manager
C000.0000.0040 Locate Directory Server
C000.0000.0080 NetBIOS
C000.0000.0100 Bridge
C000.0000.0200 IMPL Server
C000.0000.0400 Ring Authorization Server
C000.0000.0800 LAN Gateway
C000.0000.1000 Ring Wiring Concentrator
C000.0000.2000 LAN Manager

5.8 Token Ring 143


Elements of Computer Networking LAN Technologies

5.8.8 Efficiency of Token Ring Network


In a Token Ring Network, we don't have to worry about contention. We define the
percent utilization as

= 100 ×
+

Usually the time to send a token is small compared to the time to send a frame, so percent utilization
is close to 100%.

5.9 Error Detection Techniques


A node's receiver can incorrectly decide that a bit in a frame is zero when it was
transmitted as a one, and vice versa. Such bit errors are introduced by signal
attenuation and electromagnetic noise. Because there is no need to forward a datagram
that has an error, many link-layer protocols provide a mechanism to detect the
presence of one or more errors. This is done by having the transmitting node set error-
detection bits in the frame, and having the receiving node perform an error check. Error
is a very common service among - protocols.
Errors can be – or - . The term - error means that only 1 bit of a
given data unit (such as a byte, character, or packet) is changed from 1 to 0 or from 0
to 1.
In a single-bit error, only 1 bit in the data unit has changed.
Data Sent 0 0 1 1 0 1 1 0

Bit changed from 1 bit to 0 bit

Data Received 0 0 0 1 0 1 1 0

An example consider the figure above. It shows the effect of a single-bit error on a data
unit. To understand the impact of the change, imagine that each group of 8 bits is an
ASCII character with a 0 bit added to the left. In figure, 00110110 was sent but
00010110 was received.
The term (or - error) means that 2 or more bits in the data unit have
changed from 1 to 0 or from 0 to 1. Figure shows the effect of a burst error on a data
unit.
A burst error means that 2 or more bits in the data unit have changed.

Data Sent 0 0 1 1 0 1 1 0

Bits changed from 1 bit


to 0 bit and vice versa

Data Received 1 0 0 1 0 0 1 0
In this case, 00110110 was sent, but 10010010 was received. Note that a burst error
does not necessarily mean that the errors occur in consecutive bits. The length of the
burst is measured from the first corrupted bit to the last corrupted bit. Some bits in
between may not have been corrupted.

5.9.1 Redundancy
The basic idea in detecting or correcting errors is redundancy. To be able to detect or
correct errors, we need to send some extra bits with our data. These redundant bits are

5.9 Error Detection Techniques 144


Elements of Computer Networking LAN Technologies

added by the sender and removed by the receiver. Their presence allows the receiver to
detect or correct corrupted bits.

5.9.2 Detection Versus Correction


The correction of errors is more difficult than the detection. In error detection, we are
looking only to see if any error has occurred. The answer is a simple yes or no. We are
not even interested in the number of errors. A single-bit error is the same for us as a
burst error. In error correction, we need to know the exact number of bits that are
corrupted and more importantly, their location in the message.
The number of the errors and the size of the message are important factors. If we need
to correct one single error in an 8-bit data unit, we need to consider eight possible error
locations; if we need to correct two errors in a data unit of the same size, we need to
consider 2 possibilities. You can imagine the receiver’s difficulty in finding 10 errors in
a data unit of 1000 bits.

5.9.3 Hamming Distance


The number of corresponding bits that differ between two codewords is the
of those two codewords. For example, the Hamming distance between the
codewords 1001 and 0101 is 2. The Hamming distance of two codewords can be
calculated as the number of 1 bits in the bitwise exclusive-or of the two codewords:
1001 0101 = 1100.
A code is the set of all codewords of a given length that are constructed by adding a
specified number of check digits in a specified way to a specified number of data bits.
The minimum Hamming distance of a code is the minimum of the Hamming distance
between all possible pairs of codewords of that code. The following table indicates the
Hamming distance between all pairs of a simple 4-bit binary code:
The Hamming distances between codewords of a simple 4-bit code.
0000 0011 0101 0110 1001 1010 1100 1111
0000 - 2 2 2 2 2 2 4
0011 2 - 2 2 2 2 4 2
0101 2 2 - 2 2 4 2 2
0110 2 2 2 - 4 2 2 2
1001 2 2 2 4 - 2 2 2
1010 2 2 4 2 2 - 2 2
1100 2 4 2 2 2 2 - 2
1111 4 2 2 2 2 2 2 -
Because the minimum Hamming distance between any two codewords is 2, the
Hamming distance of the code is 2.

5.9.4 Single Parity Checks


The simplest form of error detection is the use of a single parity bit. Suppose that the
information to be sent, has bits. In an even parity scheme, the sender simply
includes one additional bit and chooses its value such that the total number of 1s in
the + 1 bits (the original information plus a parity bit) is even. For odd parity
schemes, the parity bit value is chosen such that there are an odd number of 1s.
0 0 1 1 0 1 1 0 0

Data Bits (d) Parity Bit


This parity check is thus computed as the modulo 2 sum of the data bits. If a single
transmission error occurs, flipping one bit in the received frame, the modulo 2 sum of

5.9 Error Detection Techniques 145


Elements of Computer Networking LAN Technologies

the bits in the frame will thus be 1, and the error is detected. In fact, the single parity
check is sufficient to detect any odd number of transmission errors in the received
frame.

5.9.5 Two-Dimensional Parity Checks


Another simple approach based on parity checks is to arrange the string of data bits
into a two-dimensional array and append a parity bit to each row and column of data
bits and an additional parity bit in the lower-right corner, as in figure.
For a sequence of = data bits, a total of + + 1 parity bits are appended.
Similar to the single parity check, an odd number of errors in any row or column will be
detected by the respective row or column parity check. In addition, an even number of
errors in a single row or column will be detected by the respective column or row parity
check. However, any pattern of four errors confined to two rows and two columns, as
shown in figure, will go undetected.

1 0 0 1 1 0 0 1 0
1 1 0 1 0 1 1 0 1
0 0 1 0 0 1 0 1 1
0 1 0 1 0 0 0 1 1 Row Parity Check
1 0 0 1 0 0 1 0 1
0 1 0 0 0 1 0 1 1
1 1 1 0 1 0 1 1 0
0 0 0 0 0 1 1 1 1
Column parity check
Column Parity Check
on Row parity checks

5.9.6 Checksums
A checksum is a value which is computed which allows you to check the validity of
something. Checksums take on various forms, depending upon the nature of the
transmission and the needed reliability. For example, the simplest checksum is to sum
up all the bytes of a transmission, computing the sum in an 8-bit counter. This value is
appended as the last byte of the transmission.
The idea is that upon receipt of bytes, you sum up the first − 1 bytes, and see if the
answer is the same as the last byte. Since this is a bit awkward, a variant on this theme
is to, on transmission, sum up all the bytes, the (treating the byte as a signed, 8-bit
value) negate the checksum byte before transmitting it. This means that the sum of all
n bytes should be 0.
These techniques are not terribly reliable; for example, if the packet is known to be 64
bits in length, and you receive 64 '\0' bytes, the sum is 0, so the result must be correct.
Of course, if there is a hardware failure that simply fails to transmit the data bytes
(particularly easy on synchronous transmission, where no "start bit" is involved), then
the fact that you receive a packet of 64 0 bytes with a checksum result of 0 is
misleading; you think you've received a valid packet and you've received nothing at all.
A solution to this is to do something like negate the checksum value computed, subtract 1
from it, and expect that the result of the receiver's checksum of the n bytes is 0xFF (-1, as a
signed 8-bit value). This means that the 0-lossage problem got resolved. As an another
example, let's say the checksum of a packet is 1 byte long. A byte is made up of 8 bits, and
each bit can be in one of two states, leading to a total of 256 (28 ) possible combinations.
Since the first combination equals zero, a byte can have a maximum value of 255.
 If the sum of the other bytes in the packet is 255 or less, then the checksum
contains that exact value.
 If the sum of the other bytes is more than 255, then the checksum is the
remainder of the total value after it has been divided by 256.

5.9 Error Detection Techniques 146


Elements of Computer Networking LAN Technologies

Let's look at a checksum example:


Bytes total =1151
= 4.496 (round to 4)
4 × 256 = 1024
1151 - 1024= 127 checksum

5.9.7 Cyclic Redundancy Check [CRC]


CRC is an international standard approach to error detection. It protects the data with a
checksum or cyclic redundancy check. CRC was first developed by the CCITT (Comite
Consultatif International Telegraphique et Telephonique) now called ITU – T (International
Telecommunications Union - Telecommunications Standards Sector).
An error-detection technique used widely in today's computer networks is based on cyclic
redundancy check (CRC) codes. CRC codes are also known as polynomial codes, since it is
possible to view the bit string to be sent as a polynomial whose coefficients are the 0 and 1
values in the bit string, with operations on the bit string interpreted as polynomial
arithmetic.
Sender Receiver
Data to be sent Data received

Calculate Verify data is


Checksum correct against
checksum
Frame
Transmitted
Data + Checksum Data + Checksum

The Cyclic Redundancy Check is the most powerful of the redundancy checking techniques,
the CRC is based on binary division. In CRC a sequence of redundant bits, called the or
the is appended to the end of a data stream. The resulting data becomes
exactly divisible by a second, predetermined binary number.
At its destination, the incoming data is divided by the same number. The diagram below will
show you the sequence of events that takes place when using CRC.
CRC technique is also applicable to data storage devices, such as a disk drive. In this
situation each block on the disk would have check bits, and the hardware might
automatically initiate a reread of the block when an error is detected, or it might report the
error to software.

[Link] How it works?


One of the most popular methods of error detection for digital signals is the Cyclic
Redundancy Check (CRC). CRC codes operate as follows. The basic idea behind CRCs is to
treat the message string as a single binary word ( for data), and divide it by a key word
that is known to both the transmitter and the receiver.
Quotient Not used
Divisor Dividend
Frame content
Remainder
Generator
polynomial
Frame size (< dividend)
used for checksum
The remainder left after dividing by constitutes the ℎ for the given message.
The transmitter sends both the message string and the check word , and the receiver can

5.9 Error Detection Techniques 147


Elements of Computer Networking LAN Technologies

then check the data by repeating the calculation, dividing by the key word , and verifying
that the remainder is . The only novel aspect of the CRC process is that it uses a simplified
form of arithmetic, which we'll explain below, in order to perform the division.
By the way, this method of checking for errors is obviously not foolproof, because there are
many different message strings that give a remainder of when divided by . In fact, about 1
out of every randomly selected strings will give any specific remainder. Thus, if our
message string is garbled in transmission, there is a chance (about , assuming the
corrupted message is random) that the garbled version would agree with the check word. In
such a case the error would go undetected. Nevertheless, by making large enough, the
chances of a random error going undetected can be made extremely small. That's really all
there is to it. The rest of our discussion will consist simply of refining this basic idea to
improve its effectiveness.
When discussing CRCs it's customary to present the key word in the form of a
whose coefficients are the binary bits of the number . For example, suppose we
want our CRC to use the key = 37. This number written in binary is 100101, and
expressed as a polynomial it is + + 1.
In order to implement a CRC based on this polynomial, the transmitter and receiver must
have agreed in advance that this is the key word they intend to use. So, for the sake of
discussion, let's say we have agreed to use the generator polynomial 100101.
By the way, it's worth noting that that the remainder of any word divided by a 6-bit word will
contain no more than 5 bits, so our CRC words based on the polynomial 100101 will always
fit into 5 bits. Therefore, a CRC system based on this polynomial would be called a 5 −
CRC. In general, a polynomial with bits leads to a − 1 CRC.
Now suppose I want to send you a message consisting of the string of bits = 0010 1100
0101 0111 0100 011, and I also want to send you some additional information that will allow
you to check the received string for correctness.
Using our agreed key word = 100101, I'll simply by to form the remainder ,
which will constitute the CRC check word. However, we are going to use a simplified kind of
division that is particularly well-suited to the binary form in which digital data is expressed.
If we interpret as an ordinary integer (37), it's binary representation, 100101, is really
shorthand for
(1)2 + (0) 2 + (0) 2 + (1) 2 + (0) 2 + (1) 2
Every integer can be expressed uniquely in this way, i.e., as a polynomial in the base 2 with
coefficients that are either 0 or 1. This is a very powerful form of representation, but it's
actually more powerful than we need for purposes of performing a data check.
Also, operations on numbers like this can be somewhat laborious, because they involve
borrows and carries in order to ensure that the coefficients are always either 0 or 1. (The
same is true for decimal arithmetic, except that all the digits are required to be in the range 0
to 9.)
To make things simpler, let's interpret our message , key word , and remainder , not
as actual integers, but as abstract polynomials in a dummy variable (rather than a
definite base like 2 for binary numbers or 10 for decimal numbers).
Also, we'll simplify even further by agreeing to pay attention only to the parity of the
coefficients, i.e., if a coefficient is an odd number we will simply regard it as 1, and if it is an
even number we will regard it as 0.
This is a tremendous simplification, because now we don't have to worry about borrows and
carries when performing arithmetic. This is because every integer coefficient must obviously
be either odd or even, so it's automatically either 0 or 1.
To give just a brief illustration, consider the two polynomials + + 1 and + + 1. If
we multiply these together by the ordinary rules of algebra we get
( + + 1)( + + 1) = + +2 +2 +2 +1
but according to our simplification we are going to call every coefficient 0, so the result
of the multiplication is simply + + 1. You might wonder if this simplified way of doing
things is really self-consistent.
5.9 Error Detection Techniques 148
Elements of Computer Networking LAN Technologies

For example, can we divide the product + + 1 by one of its factors, say, + + 1, to give
the other factor? The answer is yes, and it's much simpler than ordinary long division. To
divide the polynomial 110001 by 111 (which is the shorthand way of expressing our
polynomials) we simply apply the bit-wise exclusive-OR operation repeatedly as follows

111 110001
111

0010
000

0100
111

0111
111

000
This is exactly like ordinary long division, only simpler, because at each stage we just need to
check whether the leading bit of the current three bits is 0 or 1. If it's 0, we place a 0 in the
quotient and the current bits with 000. If it's 1, we place a 1 in the quotient
and the current bits with the divisor, which in this case is 111.
As can be seen, the result of dividing 110001 by 111 is 1011, which was our other factor, +
+ 1, leaving a remainder of 000. (This kind of arithmetic is called the arithmetic of
polynomials with coefficients from the field of integers modulo 2.)
So now let us concentrate on performing a CRC calculation with the message string and
key word defined above. We simply need to divide by using our simplified polynomial
arithmetic.
In fact, it's even simpler, because we don't really need to keep track of the quotient - all we
really need is the remainder. So we simply need to perform a sequence of 6-bit
with our key word , beginning from the left-most 1 of the message string, and at each
stage thereafter bringing down enough bits from the message string to make a 6-bit word
with leading 1. The entire computation is shown below:

00101 0 0 1 0 1 1 0 0 0 1 0 1 0 1 1 1 0 1 0 0 0 1 1
100101

00100101
100101

0000000101110
100101

00101110
100101

00101100
100101

001 00111
1 00101

0 0 0 0 1 0 remainder = CRC
Our CRC word is simply the remainder, i.e., the result of the last 6-bit exclusive OR
operation. Of course, the leading bit of this result is always 0, so we really only need the

5.9 Error Detection Techniques 149


Elements of Computer Networking LAN Technologies

last five bits. This is why a 6-bit key word leads to a 5-bit CRC. In this case, the CRC
word for this message string is 00010, so when we transmit the message word we will
also send this corresponding CRC word.
When you receive them you can repeat the above calculation on with our agreed
generator polynomial and verify that the resulting remainder agrees with the CRC
word weincluded in our transmission.
What we've just done is a perfectly fine CRC calculation, and many actual
implementations work exactly that way, but there is one potential drawback in our
method. As you can see, the computation shown above totally ignores any number of
"0"s ahead of the first 1 bit in the message. It so happens that many data strings in real
applications are likely to begin with a long series of "0"s, so it's a little bothersome that
the algorithm isn't working very hard in such cases.
To avoid this , we can agree in advance that before computing our -bit CRC we
will always begin by exclusive the leading n bits of the message string with a
string of "1"s. With this convention (which of course must be agreed by the
transmitter and the receiver in advance) our previous example would be evaluated as
follows

0 0 1 0 1 1 0 0 0 1 0 1 0 1 1 1 0 1 0 0 0 1 1  Original message string


11111  the leading bits

11010100010101110100011  message string


100101

0100000
100101

000101001
100101

00110001
100101

0101000
100101

00110111
100101

0100101
100101

0000000100011
100101

0 0 0 1 1 0 remainder = CRC
So with the convention, the 5-bit CRC word for this message string
based on the generator polynomial 100101 is 00110. That's really all there is to
computing a CRC, and many commercial applications work exactly as we've described.
People sometimes use various table-lookup routines to speed up the divisions, but that
doesn't alter the basic computation or change the result. In addition, people sometimes
agree to various non-standard conventions, such as interpreting the bits in reverse
order, but the essential computation is still the same. (Of course, it's crucial for the

5.9 Error Detection Techniques 150


Elements of Computer Networking LAN Technologies

transmitter and receiver to agree in advance on any unusual conventions they intend to
observe.)
Now that we've seen how to compute CRC's for a given key polynomial, it's natural to
wonder whether some key polynomials work better (i.e., give more robust ℎ ) than
others. From one point of view the answer is obviously yes, because the larger our key
word, the less likely it is that corrupted data will go undetected. By appending an -bit
CRC to our message string we are increasing the total number of possible strings by a
factor of 2 , but we aren't increasing the degrees of freedom, since each message string
has a unique CRC word. Therefore, we have established a situation in which only 1 out
of 2 total strings ( + ) is valid. Notice that if we append our CRC word to our
message word, the result is a multiple of our generator polynomial. Thus, of all possible
combined strings, only multiples of the generator polynomial are valid.
So, if we assume that any corruption of our data affects our string in a completely
random way, i.e., such that the corrupted string is totally uncorrelated with the original
string, then the probability of a corrupted string going undetected is 1/(2 ). This is the
basis on which people say a 16-bit CRC has a probability of 1/(2 ) = 1.5E-5 of failing to
detect an error in the data, and a 32-bit CRC has a probability of 1/(2 ), which is
about 2.3E-10 (less than one in a billion).
Since most digital systems are designed around blocks of 8-bit words (called ), it's
most common to find key words whose lengths are a multiple of 8 bits. The two most
common lengths in practice are 16-bit and 32-bit CRCs (so the corresponding generator
polynomials have 17 and 33 bits respectively). A few specific polynomials have come
into widespread use. For 16-bit CRCs one of the most popular key words is
10001000000100001, and for 32-bit CRCs one of the most popular is
100000100110000010001110110110111. In the form of explicit polynomials these
would be written as
+ + +1
and
+ + + + + + + + + + + + + +1
The 16-bit polynomial is known as the 25 , and the 32-bit polynomial is the
ℎ , and both are widely used in all sorts of applications. (Another
common 16-bit key polynomial familiar to many modem operators is
11000000000000101, which is the basis of the − 16 protocol). These polynomials
are certainly not unique in being suitable for CRC calculations, but it's probably a good
idea to use one of the established standards, to take advantage of all the experience
accumulated over many years of use.
Nevertheless, we may still be curious to know how these particular polynomials were
chosen. It so happens that one could use just about ANY polynomial of a certain degree
and achieve most of the error detection benefits of the standard polynomials. For
example, -bit CRC will certainly catch any single of m consecutive
for any less than , basically because a smaller polynomial can't be a multiple of
a larger polynomial. Also, we can ensure the detection of any odd number of bits simply
by using a generator polynomial that is a multiple of the , which is +
1. A polynomial of our simplified kind is a multiple of + 1 if and only if it has an even
number of terms.
It's interesting to note that the standard 16-bit polynomials both include this parity
check, whereas the standard 32-bit CRC does not. It might seem that this represents a
shortcoming of the 32-bit standard, but it really doesn't, because the inclusion of a
parity check comes at the cost of some other desirable characteristics. In particular,
much emphasis has been placed on the detection of two separated single-bit errors, and
the standard CRC polynomials were basically chosen to be as robust as possible in
detecting such double-errors. Notice that the basic E representing two
5.9 Error Detection Techniques 151
Elements of Computer Networking LAN Technologies

erroneous bits separated by bits is of the form + 1 or, equivalently, - 1. Also, an


error superimposed on the message will be undetectable if and only if is a
multiple of the key polynomial . Therefore, if we choose a key that is not a divisor of
any polynomial of the form - 1 for =1,2, . . . , , then we are assured of detecting any
occurrence of precisely two erroneous bits that occur within places of each other.
How would we find such a polynomial? For this purpose we can use a
. For example, suppose we want to ensure detection of two bits within 31
places of each other. Let's factor the error polynomial - 1 into it's irreducible
components (using our simplified arithmetic with coefficients reduced modulo 2). We
find that it splits into the factors
- 1 = ( +1) × ( + + + + 1) × ( + + + + 1) ×
( + + + + 1) × ( + + 1) × ( + + + + 1) × ( + + 1)
Aside from the parity factor (x+1), these are all primitive polynomials, representing
primitive roots of - 1, so they cannot be divisors of any polynomial of the form -1
for any less than 31. Notice that + + 1 is the generator polynomial 100101 for the
5-bit CRC in our first example.
Another way of looking at this is via recurrence formulas. For example, the polynomial
+ + 1 corresponds to the recurrence relation s[ ] = (s[ − 3] + s[ − 5]) modulo 2.
Beginning with the initial values 00001 this recurrence yields
|--> cycle repeats
0000100101100111110001101110101 00001
Notice that the sequence repeats with a period of 31, which is another consequence of
the fact that + + 1 is primitive. You can also see that the sets of five consecutive
bits run through all the numbers from 1 to 31 before repeating. In contrast, the
polynomial + + 1 corresponds to the recurrence s[ ] = (s[ − 4] + s[ − 5]) modulo 2,
and gives the sequence
|--> cycle repeats
000010001100101011111 00001
Notice that this recurrence has a period of 21, which implies that the polynomial +
+ 1 divides - 1. Actually, + + 1 can be factored as ( + + 1)( + + 1), and
both of those factors divide - 1. Therefore, the polynomial + + 1 may be
considered to give a less robust CRC than + + 1, at least from the standpoint of
maximizing the distance by which two erroneous bits must be separated in order to go
undetected.
On the other hand, there are error patterns that would be detected by + + 1 but
would NOT be detected by + + 1. As noted previously, any -bit CRC increases the
space of all strings by a factor of 2 , so a completely arbitrary error pattern really is no
less likely to be detected by a polynomial than by a "good" one. The distinction
between good and bad generators is based on the premise that the most likely error
patterns in real life are NOT entirely random, but are most likely to consist of a very
small number of bits (e.g., one or two) very close together. To protect against this kind
of corruption, we want a generator that maximizes the number of bits that must be
to get from one formally valid string to another. We can certainly cover all 1-bit
errors, and with a suitable choice of generators we can effectively cover virtually all 2-
bit errors.

Problems and Questions with Answers


Question 1: What is early token release?

5.9 Error Detection Techniques 152


Elements of Computer Networking LAN Technologies

: In normal token ring operation, a station sending information holds the token
until the sending data circles the entire ring. After the sending station strips the data
from the ring, it then issues a free token.
With Early Token Release (ETR), a token is released immediately after the sending
station transmits its frame. This allows for improved performance, since there is no
delay in the downstream neighbour waiting for the token. ETR is only available on 16
megabit rings.
Question 2: What is the difference between Ethernet and Token Ring networks?
: Token Ring is single access, meaning there is only one token. So, at
only one station is able to use the LAN. Ethernet is a shared access medium,
where all stations have equal access to the network at the time.
Question 3: At what speeds does token ring run?
: Token ring runs at speeds of 4 Mbps and 16 Mbps.
Question 4: What is a beacon frame?
: A beacon frame is sent generated by a station or stations that do not detect a
receive signal. A station or stations will broadcast these beacon MAC frames with until
the receive signal is restored.
Question 5: Medium access methods can be categorized as random, maximized or
minimized.
: False
Question 6: ALOHA is an early multiple-random-access method that requires frame
acknowledgment.
: True
Question 7: In the carrier sense multiple-access (CSMA) method, a station must listen
to the medium prior to the sending of data onto the line.
: True
Question 8: In the carrier sense multiple-access (CSMA) method, the server will let a
device know when it is time to transmit.
: False
Question 9: Some examples of controlled-access methods are: reservation, polling and
token passing.
: True
Question 10: Carrier sense multiple access with collision avoidance (CSMA/CA) is CSMA
with procedures added to correct after a collision has happened.
: False
Question 11: Carrier sense multiple access with collision detection (CSMA/CD) is CSMA
with a post collision procedure.
: True
Question 12: FDMA, TDMA and CDMA are controlled-access methods.
: False
Question 13: Channelization is a multiple-access method in which the available
bandwidth of a link is shared in time, frequency, or through code, between stations
on a network.

5.9 Error Detection Techniques 153


Elements of Computer Networking LAN Technologies

: True
Question 14: In the reservation access method, a station reserves a slot for data by
controlling transmissions to and from secondary stations.
: False
Question 15: Multiple Access Protocols include:
A. Random-Access Protocols C. Channelization Protocols
B. Controlled-Access Protocols D. All of the above.
:D
Question 16: ALOHA is an example of the earliest:
A. Random-access method C. Channelization protocols
C. Controlled-access method D. All of the above.
:A
Question 17: Polling works with topologies in which one devise is designated as the
___station and the other devices are known as ___ devices.
A. Secondary / primary C. Permanent / switched
B. Primary / secondary D. Physical / virtual
:B
Question 18: The select mode is used when:
A. the sender has something to format. C. the primary device has something to send.
B. the receiver has something to receive. D. the secondary device has something to send.
:C
Question 19: The act of polling secondary devices is so that:
A. The primary device can solicit transmissions from the secondary devices.
B. The secondary devices can solicit transmissions from the primary devices.
C. The secondary device wants to over-ride the primary device.
D. The primary device is in flex mode.
:A
Question 20: Polling is a type of:
A. Random-access C. channelization access
B. Controlled-access D. None of the above.
:B
Question 21: In the reservation access method, a station needs to make a reservation
before:
A. Sending data C. Both A and B.
B. Receiving data D. None of the above.
:A
Question 22: In a channelization access method, the available bandwidth of a link is
shared:
A. In time C. via code
B. In frequency D. All of the above.
:D
Question 23: What is the advantage of controlled access over random access?
: In a random access method, each station has the right to the medium without
being controlled by any other station. However, if more than one station tries to send,
there is an access conflict (collision) and the frames will be either destroyed or modified.
To avoid access collisions or to resolve it when it happens, we need procedures to
address the issues caused by collisions or to try to avoid them, if possible. Some
examples of random access include ALOHA and CSMA.

5.9 Error Detection Techniques 154


Elements of Computer Networking LAN Technologies

In controlled access, the stations consult with one another to find which station has the
right to send. A station cannot send unless it has been authorized by other stations.
Three popular controlled access methods include: Reservation, polling and token-
passing.
Question 24: Groups of stations share a 64 pure ALOHA channel. Each station
outputs a 1000 bit frame on an average of once every 100 seconds. What is the
maximum value of (i.e. how many stations can be connected)?
: The maximum throughput for pure Aloha is 18.4%.
Therefore the usable channel rate is equal to 0.184 ∗ 56 = 11.77 .
Bits per second outputted by each station = = 10 [ = ]
station outputs 10 bps on a channel which has the usable channel rate of 11.77 .
. ×
∴ = = 1177 stations

Question 25: Consider 2 stations at a distance of 2 from each other. A station


transmits frames of length 200 bits at the rate of 2 . Velocity of propagation is
3 × 10 / . Assume that each station generates frames at an average rate of 10000
frames per second. What is the probability of collision for pure ALOHA?
: Before solving the problem let us define the formulas for propagation and
transmission times.
: The transmission time is the amount of time from the beginning
until the end of a message transmission. In the case of a digital message, it is the time
from the first bit until the last bit of a message has left the transmitting node. The
packet transmission time in seconds can be obtained from the packet size in bit and the
bit rate in bit/s as:

=
For example, a 100 Mbit/s (or 10,000,000 bits per second) Ethernet and maximum

packet size of 1526 bytes gives a maximum packet transmission time = ≈ 122
µ .
: Propagation time is the amount of time it takes for the head of the
signal to travel from the sender to the receiver. It can be computed as the ratio between
the link length and the propagation speed over the specific medium.

From the problem statement we have the value: 10 (10000 frames per second).
×
= + = + = 66.67 × 10
× ×
The probability of collision in pure ALOHA is:
=1−
× × . ×
=1−
.
=1−
= 1- (2.718) . = 1 − 0.27 = 0.73
Question 26: Consider the delay of pure ALOHA versus slotted ALOHA at low load.
Which one is less? Explain your answer.
: Statistically pure ALOHA is supposed to be less efficient than slotted ALOHA
(both at normal load or when collisions occur in a contention channel). However, if the
load is low, then pure ALOHA is supposed to be as efficient as slotted ALOHA. But if we
consider the delay of sending the packet in a slotted time as in the slotted ALOHA
protocol, then we can say that slotted ALOHA’s delay is more than the one in pure
ALOHA protocol, which sends the packet immediately.

5.9 Error Detection Techniques 155


Elements of Computer Networking LAN Technologies

Question 27: The valid frame length must be at least 64 bytes long so as to prevent a
station from completing the transmission of a short frame before the first bit has
even reached the far end of the cable, where it may collide with another frame. How
is the minimum frame length adjusted if the network speed goes up?
: As the network speed goes up, the minimum frame length must go up or the
maximum cable length must come down, proportionally so that the sender does not
incorrectly conclude that the frame was successfully sent in case of collision.
Question 28: TDM with sources having different data rates: Consider the case of three
streams with bit rates of 8 kbit/sec, 16 kbit/sec, and 24 kbit/sec, respectively. We
want to combine these streams into a single high-speed stream using TDM.
: The high-speed stream in this case must have a transmission rate of 48
kbit/sec, which is the sum of the bit rates of the three sources. To determine the
number of time slots to be assigned to each source in the multiplexing process. We
must reduce the ratio of the rates, [Link], to the lowest possible form, which in this
case is [Link]. T
he sum of the reduced ratio is 6, which will then represent the minimum length of the
repetitive cycle of slot assignments in the multiplexing process. The solution is now
readily obtained: In each cycle of six time slots we assign one slot to Source A (8
kbit/sec), two slots to Source B (16 kbit/sec), and three slots to Source: C (24 kbit/sec).
Figure 7-4 illustrates this assignment, using “a” to indicate data from Source A, “b” to
indicate data from Source B, and “c” to indicate data from Source C.
Question 29: Consider a system with four low-bit-rate sources of 20 kbit/sec, 30
kbit/sec, 40 kbit/sec, and 60 kbit/sec. Determine the slot assignments when the
data streams are combined using TDM.
: The rate ratio [Link] reduces to [Link]. The length of the cycle is
therefore 2 + 3 + 4 + 6 = 15 slots. Within each cycle of 15 slots, we assign two slots to
the 10 kbit/sec source, three slots to the 15 kbit/sec source, four slots to the 20
kbit/sec source, and six slots to the 30 kbit/sec source.
Question 30: Explain why the hidden terminal problem can be solved by CSMA/CA
protocol.
: A hidden station problem occurs in a wireless LAN if we use CSMA access
protocol. Suppose each station A, B, C and D aligns in a line from left to right.
Assuming station A is transmitting from to B, however, station C cannot sense the
transmission signal because it is out of range of A, it falsely assumes that it is safe to
transmit to B. This will cause a collision at station B, which called a hidden station
problem since the competitor is too far away to be detected.
The main reason to cause this problem is that the sender doesn’t have a correct
knowledge about the receiver’s activity. CSMA can only tell whether there is an activity
around. However, by using CSMA/CA protocol, the sender can get the receiver’s status
through the handshaking. For instance, station C can receive the stations B’s CTS and
know how long the station A will take to transmit data. It will stop its transmission
request before station A completes.
Question 31: Given the following information, find the minimum bandwidth required for
the path:
 FDM Multiplexing
 Five devices, each requiring 4000 Hz.
 200 Hz guard band for each device.
:
No. of devices = 5.
No. of guard bands required between these is 4.
Hence total bandwidth = (4000 × 5) + (200 × 4) = 20.8 KHz.
5.9 Error Detection Techniques 156
Elements of Computer Networking LAN Technologies

Question 32: A small Local Area Network (LAN) has four machines A, B, C and D
connected in the following topology:

LAN-1 LAN-2
Bridge

Node-A Node-B Node-C Node-D


A) The node A sends a graphics file of size 10 MB simultaneously to nodes B, C, and
D using Unicast packets constructed by the Universal Datagram Protocol (UDP).
Calculate the utilization of LAN 1, given that each frame carries 1024 B of UDP
payload data, and transmission is at 50 packets per second to each destination.
B) What is the utilization on LAN 2?
: Refer chapter.
Question 33: Consider a group of n stations sharing a 64 kbps pure (unslotted) aloha
channel. Each station has one (NEW) packet arriving every 100 seconds and
packets are 1000 bits long. What is the maximum value of that the channel can
accommodate?
: The required data rate is ×(1000 bits per packet)×(1 packet/100 seconds) =
10 bps. Since, efficiency = 18%, with unslotted aloha, the available data rate is 0.18 *
64,000 bps = 11,520 bps.
Rate required = Rate available
→ 10 = 11
→ 520 ≤ 1152 stations
Question 34: CSMA/CD: Suppose a CSMA/CD network is running at 10 Mbps over a 1-
km cable with no repeaters. The signal speed in the cable is 200,000 km/sec.
Compute the following.
A) End-to-end propagation delay B) Worst-case collision detection time
C) Minimum frame size
D) Suppose we increase the bandwidth from 10 Mbps to 100 Mbps, how does it
affect the above three values?
Question 35: For a peer-to-peer file-sharing application, do you agree with the
statement, "There is no notion of client and server sides of a communication
session"?
: . All communication sessions have a client side and a server side. In a -
- file-sharing application, the peer that is receiving a file is typically the client and
the peer that is sending the file is typically the server.
Question 36: How does CSMA/CD react to collisions?
A) All systems jam the network, and then all begin transmitting again.
B) Hosts involved in a collision send an RTS signal indicating a time frame in which
to retransmit.
C) Hosts involved in the collision send a jam signal, and then run an algorithm
before retransmitting.
D) Collisions do not occur on CSMA/CD.
: C.
Question 37: How is equal access to the wire managed in a collision-oriented
environment such as Ethernet?
A) The hosts are given equal access based on the circulation of a token; hosts
can only transmit when they hold the token.
B) Hosts are given prioritized access to the wire based on their MAC address.
C) Hosts are given equal access to the wire by being allowed to transmit at
5.9 Error Detection Techniques 157
Elements of Computer Networking LAN Technologies

specified time intervals.


D) Hosts signal their desire to transmit by sending a contention alert.
E) Hosts check the wire for activity before attempting to send; if a collision
happens, they wait a random time period before attempting to send again.
: E.
Question 38: End-to-end packet delay of cut-through routers is smaller than of store &
forward routers. Is it true or false?
: True. With cut-though routers a packet starts being transmitted as soon as its
header is processed; with store & forward routers a packet is first received in its entirety
before being forwarded.
Question 39: Three users X, Y and Z use a shared link to connect to the Internet. Only
one of X, Y or Z can use the link at a given time. The link has a capacity of 1Mbps.
There are two possible strategies for accessing the shared link:
• TDMA: equal slots of 0.1 seconds.
• : adds a latency of 0.05 seconds before taking the turn. The user can
then use the link for as long as it has data to send. A user requests the link only
when it has data to send.
In each of the following two cases, which strategy would you pick and why?
A) X, Y and Z send a 40 KBytes file every 1 sec.
B) X sends 80 KBytes files every 1sec, while Y and Z send 10 KBytes files every
1sec.
:
A) TDMA. Why: Each of the users generate a load of 40 KB/s = 0.32 Mbps, which can
be fully transmitted given the share of 0.33 Mbps available per user when partitioning
the channel with TDMA. Taking turns on the other hand does not offer enough capacity
for all the files to be transmitted: 3×0.32 + 3×0.05 = 1.11 s > 1 s, and would incur
extra overhead.
B) Taking Turns. Why? First, by using TDMA, X does not have enough capacity to
transmit, 80 KB/s = 0.640 Mbps > 0.33 Mbps. Second, with TDMA, Y and Z waste 3 out
of 4 slots. On the other hand, when taking turns, there is enough capacity to transmit
all the data: 0.64 + 0.05 + 0.08 + 0.05 + 0.08 + 0.05 = 0.95 s.
Question 40: Comparing pure ALOHA and slotted ALOHA, which one can lead to a
shorter delay when the traffic load is very small? Why?
: Pure ALOHA has shorter delay because it does not need to wait for the
beginning for the next time slot.
Question 41: A variety of signal encoding techniques are used in the various LAN
standards to achieve efficiency and to make the high data rates practical. Is it true
or false?
: True
Question 42: An algorithm is needed with CSMA to specify what a station should do if
the medium is found busy. Is it true or false?
: True
Question 43: The p-persistent algorithm with binary exponential backoff is efficient over
a wide range of loads. Is it true or false?
: False
Question 44: Ethernet has both a medium access control layer and a physical layer. Is it
true or false?
5.9 Error Detection Techniques 158
Elements of Computer Networking LAN Technologies

: True
Question 45: With full-duplex operation a station can transmit and receive
simultaneously. Is it true or false?
: True
Question 46: A technique known as slotted ____ organizes time on the channel into
uniform slots whose size equals the frame transmission time. Transmission is
permitted to begin only at a slot boundary.
A) Ethernet B) ALOHA C) boundary relay D) CSMA
:B
Question 47: Ethernet now encompasses data rates of ____.
A) 100 Mpbs, 1 Gbps, 10 Gbps, and 100 Gbps
B) 10 Mbps, 100 Mpbs, 1 Gbps, and 10 Gbps
C) 1 Gpbs, 10 Gbps, 100 Gbps, and 1000 Gbps
D) 10 Mbps, 100 Mbps, 1000 Mbps, and 10 Gbps
:B
Question 48: A problem with ____ is that capacity is wasted because the medium will
generally remain idle following the end of a transmission, even if there are one or
more stations waiting to transmit.
A) 1-persistent CSMA B) slotted ALOHA
C) p-persistent CSMA D) nonpersistent CSMA
:D
Question 49: One of the rules for CSMA/CD states, "after transmitting the jamming
signal, wait a random amount of time, then attempt to transmit again". This
random amount of time is referred to as the ___.
A) Precursor B) Backoff C) Backlog D) carrier time
:B
Question 50: Which of the following makes use of two optical fibre cables, one for
transmission and one for reception, and utilizes a techniques known as intensity
modulation.
A) 100BASE-T4 B) 10BASE-F C) 100BASE-FX D) 10BASE-T
:C
Question 51: Why do 802.11 (wireless) networks use acknowledgements?
: Unlike a wired Ethernet where collisions can be detected, it is difficult to detect
a collision on a wireless network as the strength of the signal being transmitted is so
much greater than the strength of the signal being received. Without being able to
detect a collision, a sender is unsure if their transmitted data arrived intact, thus a
mechanism for acknowledgements must be used.
Question 52: Why are the wires twisted in twisted-pair copper wire?
: The twisting of the individual pairs reduces electromagnetic interference. For
example, it reduces crosstalk between wire pairs bundled into a cable.
Question 53: Which type of Ethernet framing is used for TCP/IP and AppleTalk?
A) Ethernet 802.3 B) Ethernet 802.2 C) Ethernet II D) Ethernet SNAP
: D. Ethernet 802.3 is used with NetWare versions 2 through 3.11, Ethernet
802.2 is used with NetWare 3.12 and later plus OSI routing, Ethernet II is used with
TCP/IP and DECnet, and Ethernet SNAP is used with TCP/IP and AppleTalk.
Question 54: Ethernet is said to be non-deterministic because of which of the following?
5.9 Error Detection Techniques 159
Elements of Computer Networking LAN Technologies

A) It is not possible to determine how long it will take to get a frame from one device
to another.
B) It is not possible to determine whether an error has occurred during the
transmission of a frame.
C) It is not possible to determine if another device wishes to transmit.
D) It is not possible to determine the maximum time a device will have to wait to
transmit.
:D
Question 55: The multiplexer creates a frame that contains data only from those input
sources that have something to send in __ multiplexing.
A) Frequency Division B) Statistical Time Division
C) Synchronous Time Division D) Dense Wavelength
:B
Question 56: How many 8-bit characters can be transmitted per second over a 9600
baud serial communication link using asynchronous mode of transmission with one
start bit, eight data bits, and one parity bit ?
A) 600 B) 800 C) 876 D) 1200
: B. Baud is the symbol which is sent over the link, baud = 9600 bits 18 bit
character has baud size of 12 bits. So no. of characters = = 800.

Question 57: A and B are the only two stations on an Ethernet. Each has a steady
queue of frames to send. Both A and B attempt to transmit a frame, collide, and A
wins the first backoff race, At the end of this successful transmission by A, both A
and B attempt to transmit and collide. The probability that A wins the second
backoff race is
A) 0.5 B) 0.625 C) 0.75 D) 1.0
: B. A wins the first back off race the conditions are (0,1). After that during
second back off four conditions (0,1,2,3).

Probability = × + × = + = 0.625

Question 58: In a network of LANs connected by bridges, packets are set from one LAN
to another through intermediate bridges. Since more than one path may exist
between two LANs, packets may have to be routed through multiple bridges. Why is
the spanning tree algorithm used for bridge-routing?
A) For shortest path routing between LANs
B) For avoiding loops in the routing paths
C) For fault tolerance D) For minimizing collisions
: B. Spanning tree algorithm for a graph is applied to find a tree free of cycles, so
in this network we apply spanning tree algorithm to remove loops in routing paths.

5.9 Error Detection Techniques 160


Elements of Computer Networking ARP and RARP

Chapter

ARP and RARP 6


6.1 Address Resolution Protocol [ARP]
6.1.1 What is Address Resolution Protocol [ARP]?
Address Resolution Protocol [ARP] is a network layer protocol that is used to convert IP
address into MAC address. Network interface cards (NICs) each have a hardware
address or MAC address associated with them. Applications understand TCP/IP
addressing, but network hardware devices (such as NICs) do not.
For example, when two Ethernet cards are communicating, they have no knowledge of
the IP address being used. Instead, they use the MAC addresses assigned to each card
to address data frames. The ARP was designed to provide a mapping from the logical
32-bit TCP/IP addresses to the physical 48-bit MAC addresses.
ARP resolves IP addresses used by TCP/IP-based software to media access control
addresses used by LAN hardware.

6.1.2 Why do we need Address Resolution Protocol [ARP]?


An Internet is made of a combination of ℎ networks connected together by
internetworking devices such as and . A packet starting from a source
host may pass through different physical networks before finally reaching the
destination host.

The hosts and routers are recognized at the network level by their logical addresses. A
address is an address. A logical address is unique universally. It is

6.1 Address Resolution Protocol [ARP] 161


Elements of Computer Networking ARP and RARP

called a logical address it is usually implemented in software. Every protocol


that deals with interconnecting networks requires logical addresses. The logical
addresses in the TCP/IP protocol suite are called IP addresses and are 32 bits long.
However, packets pass through physical networks to reach these hosts and routers. At
the physical level, the hosts and routers are recognized by their physical addresses. A
physical address is a local address. Its scope is a local network. It should be unique
locally, but not necessary universally. It is called a ℎ because it is usually
(not always) implemented in hardware. Examples of physical addresses are 48 bit MAC
addresses in Ethernet and token ring protocols, which are imprinted on the NIC
installed in the host or router.
The physical and logical addresses are two different identifiers. We need both of them
because a physical network, such as an Ethernet can be used by two different protocols
at the network layer such as IP and IPX (Novell) at the same time. Likewise, a packet at
the network layer such as IP may pass through different physical networks such as
Ethernet and LocalTalk.
This means that delivery of a packet to a host or a router requires two levels of
addressing: logical and physical.
The main issue is that IP datagrams contain IP addresses, but the physical interface
hardware on the host or router to which we want to send the datagram only
understands the addressing scheme of that particular network.

6.1.3 Address Mapping and Resolution


We need to be able to map a logical address to its corresponding physical address and
vice versa. These can be done using either or mapping.
mapping means creating a table that associates a logical address with a physical
address. This table is stored in each machine on the network. Each machine that
knows, for example, the IP address of another machine but not its physical address,
can look it up in the table. This has some limitations because physical addresses may
change in the following ways:
A machine could change its NIC resulting in a new physical address. In some LANs,
such as LocalTalk, the physical address changes every time the computer is turned on.
A mobile computer can move from one physical network to another, resulting in a
change in its physical address. To implement these changes, a static mapping table
must be updated periodically. This creates a huge overhead on the network.
In mapping each time a machine knows one of the two addresses (logical or
physical), it can use a protocol to find the other one.
is the process of finding the address of a host within a network. In
this case, the address is resolved by using a protocol to request information via a form
of broadcast to locate a remote host. The remote host receives the packet and forwards
it with the appropriate address information included. The address resolution process is
complete once the original computer has received the address information.
Two protocols have been designed to perform dynamic mapping: Address Resolution
Protocol (ARP) and Reverse Address Resolution Protocol (RARP). The first maps a logical
address to a physical address; the second maps a physical address to a logical address.
ARP

32-bit IP 48-bit MAC


Addresses Addresses
RARP

6.1 Address Resolution Protocol [ARP] 162


Elements of Computer Networking ARP and RARP

The goal of ARP is to enable each host on a network to build up a table of


between IP addresses and link-level addresses (MAC addresses). Since these mappings
may change over time, the entries are and . ARP takes
advantage of the fact that many link-level network technologies (such as Ethernet and
token ring) support broadcast. If a host wants to send an IP datagram to a host that it
knows to be on the same network, it first checks for a mapping in the cache.
ARP maintains the protocol rules for making this translation and providing address
conversion in both directions within the OSI layers, as shown in figure below. This
utility is used to display and modify entries within the ARP table.
In summary, ARP translates IP addresses into MAC addresses and the Reverse Address
Resolution Protocol (RARP) is used to find IP address from a MAC address.

6.1.4 Four Different Cases


Anytime a host, or a router, needs to find the physical address of another host or router
on its network, it sends an ARP packet. The packet includes the physical and IP
addresses of the and the IP address of the . Because the sender does not
know the physical address of the receiver, the query is broadcast over the net-work.
Every host or router on the network receives and processes the ARP query packet, but
only the intended recipient recognizes its IP address and sends back an ARP
packet. The response packet contains the ′ IP and physical addresses. The
packet is unicast directly to the sender using the physical address received in the query
packet. Now sending system can send all the packets it has for this destination using
the physical address received.
The following are different cases in which the services of ARP can be used.
1. The sender is a host and wants to send a packet to another host on the
network. In this case, the logical address that must be mapped to a physical
address is the destination IP address in the datagram header.
2. The sender is a host and wants to send a packet to another host on ℎ
network. In this case, the host looks at its routing table and finds the IP
address of the next hop-router for this destination. If it does not have a routing
table, it looks for IP address of the default router. The IP address of the router
becomes the logical address that must be mapped to a physical address. Note
that IP address is still the destination address but the physical address is the
MAC address of the next hop-router for that destination.
3. The sender is a router that has received a datagram destined for a host on
another network. It checks its routing table and finds the IP address of the next
router. The IP address of the next router becomes the logical address that must
be mapped to a physical address. Note that IP address is still the destination
address but the physical address is the MAC address of the next router for that
destination.
4. The sender is a router that has received a datagram destined for a host in the
network. The destination IP address of the datagram becomes the logical
address that must be mapped to a physical address.

6.1.5 How ARP resolves MAC addresses for Local Traffic


In this example, two TCP/IP nodes, nodes 1 and 2, are both located on the same
physical network. Node 1 is assigned the IP address of [Link] and Node 2 is assigned
the IP address of [Link].

6.1 Address Resolution Protocol [ARP] 163


Elements of Computer Networking ARP and RARP

1. ARP cache is checked


Node-1
5. ARP entry added

2. ARP request sent

4. ARP reply sent

3. ARP entry added

Node-3
Node-2

When Node 1 tries to communicate with Node 2, the following steps resolve Node 2's
software-assigned address ([Link]) to Node 2‘s hardware-assigned media access
control address:
1. Based on the contents of the routing table on Node 1, IP determines that the
forwarding IP address to be used to reach Node 2 is [Link]. Node 1 then
checks its own local ARP cache for a matching hardware address for Node 2.
2. If Node 1 finds no mapping in the cache, it broadcasts an ARP request frame to
all hosts on the local network with the question "What is the hardware address
for [Link]?" Both hardware and software addresses for the source, Node 1,
are included in the ARP request.
3. Each host on the local network receives the ARP request and checks for a
match to its own IP address. If a host does not find a match, it discards the ARP
request.
4. Node 2 determines that the IP address in the ARP request matches its own IP
address and adds a hardware/software address mapping for Node 1 to its local
ARP cache.
5. Node 2 sends an ARP reply message containing its hardware address directly
back to Node 1.
6. When Node 1 receives the ARP reply message from Node 2, it updates its ARP
cache with a hardware/software address mapping for Node 2.
Once the media access control address for Node 2 has been determined, Node 1 can
send IP traffic to Node 2 by addressing it to Node 2's media access control address.

6.1.6 How ARP resolves MAC addresses for Remote Traffic


ARP is also used to forward IP datagrams to local routers for destinations that are
on the network. In this situation, ARP resolves the media access control address of
a router interface on the local network.

The following diagram shows how ARP resolves IP addresses to hardware addresses for
two hosts on different physical networks connected by a common router.

6.1 Address Resolution Protocol [ARP] 164


Elements of Computer Networking ARP and RARP

1. ARP cache is checked


Node-1

2. ARP request sent

4. ARP reply sent

3. ARP entry added

Node-2
Router

In this example, Node 1 is assigned an IP address of [Link] and Node 2 uses an IP


address of [Link]. Router interface 1 is on the same physical network as Node 1
and uses the IP address [Link]. Router interface 2 is on the same physical network as
Node 2 and uses the IP address [Link].
When Node 1 tries to communicate with Node 2, the following steps resolve Router
interface 1's software-assigned address ([Link]) to its hardware-assigned media
access control address:
1. Based on the contents of the routing table on Node 1, IP determines that the
forwarding IP address to be used to reach Node 2 is [Link], the IP address of
its default gateway. Node 1 then checks its own local ARP cache for a matching
hardware address for [Link].
2. If Node 1 finds no mapping in the cache, it broadcasts an ARP request frame to
all hosts on the local network with the question "What is the hardware address
for [Link]?" Both hardware and software addresses for the source, Node 1,
are included in the ARP request.
Each host on the local network receives the ARP request and checks for a
match to its own IP address. If a host does not find a match, it discards the ARP
request.
3. The router determines that the IP address in the ARP request matches its own
IP address and adds a hardware/software address mapping for Node 1 to its
local ARP cache.
4. The router then sends an ARP reply message containing its hardware address
directly back to Node 1.
5. When Node 1 receives the ARP reply message from the router, it updates its
ARP cache with a hardware/software address mapping for [Link].

Once the media access control address for Router interface 1 has been determined,
Node 1 can send IP traffic to Router interface 1 by addressing it to the Router interface
1 media access control address. The router then forwards the traffic to Node 2 through
the same ARP process as discussed in this section.

6.1 Address Resolution Protocol [ARP] 165


Elements of Computer Networking ARP and RARP

6.1.7 ARP Cache


To minimize the number of broadcasts, ARP maintains a ℎ of IP address-to-media
access control address mappings for future use. The ARP cache can contain both
dynamic and static entries. Dynamic entries are added and removed automatically over
time. Static entries remain in the cache until the computer is restarted.

Each dynamic ARP cache entry has a potential lifetime of 10 minutes. New entries
added to the cache are . If an entry is not reused within 2 minutes of being
added, it expires and is removed from the ARP cache. If an entry is used, it receives two
more minutes of lifetime. If an entry keeps getting used, it receives an additional two
minutes of lifetime up to a maximum lifetime of 10 minutes.

We can view the ARP cache by using the command. To view the ARP cache, type
− at a command prompt.
:
Interface: [Link] --- 0xf

[Link] 00-08-5c-8d-4f-8f dynamic
[Link] ff-ff-ff-ff-ff-ff static
[Link] 01-00-5e-00-00-fc static
[Link] ff-ff-ff-ff-ff-ff static

The ARP Cache is needed for improving efficiency on the operation of the ARP. The
cache maintains the recent mappings from the Internet addresses to hardware
addresses. The normal expiration time of an entry in the cache is 20 minutes from the
time the entry was created.

6.1.8 Proxy ARP


Proxy ARP lets a router answer ARP requests on one of its networks for a host on
another of its networks. This fools the sender of the ARP request into thinking that the
router is the destination host, when in fact the destination host is ℎ ℎ of
the router. The router is acting as a proxy agent for the destination host, relaying
packets to it from other hosts.

6.2 Reverse Address Resolution Protocol [RARP]


6.2.1 What is Reverse Address Resolution Protocol (RARP)?
Reverse Address Resolution Protocol (RARP) is a network layer protocol used to convert
an IP address from a given physical address. RARP is the complement of ARP.

As seen in previous section, ARP allows device a node to say “ 1 ℎ


2′ , 2 ℎ ”.

In contrast, RARP is used by Node 1 to say “ 1 ℎ


ℎ , ?”

The RARP packet format is almost identical to the ARP packet. An RARP request is
broadcast, identifying the sender’s hardware address, asking for anyone to respond with
the sender’s IP address. The reply is normally unicast.

6.2 Reverse Address Resolution Protocol [RARP] 166


Elements of Computer Networking ARP and RARP

6.2.2 Why do we need RARP?


When an IP machine happens to be a diskless machine, it has no way of initially
knowing its IP address. But it does know its MAC address. RARP is used by many
diskless systems to obtain their IP address when bootstrapped.
RARP enables diskless computers to obtain an IP address prior to loading any advanced
operating system. Historically, it has been used for Unix-like diskless workstations
(which also obtained the location of their boot image using this protocol) and also by
corporations to roll out a pre-configured client (e.g. Windows) installation to newly
purchased PCs.

6.2.3 RARP Server


RARP discovers the identity of the IP address for diskless machines by sending out a
packet that includes its MAC address and a request for the IP address assigned to that
MAC address. A designated machine, called a , responds with the answer.
The next question then is: who knows Node 1's IP address if Node 1 doesn't? The
answer is that a special RARP server must be configured to listen for RARP requests
and issue replies to them. Each physical network where RARP is in use must have
RARP software running on at least one machine.

6.2.4 How RARP works?


RARP is used by Node 1 to say “I am Node 1 and I am sending this broadcast using my
hardware address, can someone please tell me my IP address?” it is providing its own
hardware address and asking for an IP address it can use.

1. My hardware address is 00-08-5c-


Node-1 8d-4f-8f, what is my IP address?

2. RARP request sent

3. RARP reply sent: I heard the


broadcast. Your IP is
[Link] with hardware
address is 00-08-5c-8d-4f-8f

Node-2, Node-3
RARP Server

Any device on the network that is set up to act as an RARP server responds to the
broadcast from the source. It generates an RARP reply.
Below are some key points in RARP process.
1. Sender generates RARP request message: The source node generates an RARP
request message. It puts its own MAC address as both the sender MAC and also
the destination MAC. It leaves both the sender IP Address and the destination
IP Address blank, since it doesn't know either.
2. Sender broadcasts RARP request message: The source broadcasts the ARP
request message on the local network.

6.2 Reverse Address Resolution Protocol [RARP] 167


Elements of Computer Networking ARP and RARP

3. Local nodes process RARP request message: The message is received by each
node on the local network and processed. Nodes that are not configured to act
as RARP servers ignore the message.
4. RARP server generates RARP reply message: Any node on the network that is
set up to act as an RARP server responds to the broadcast from the source
device. It generates an RARP reply. It sets the sender MAC address and sender
IP address to its own hardware and IP address of course, since it is the sender
of the reply. It then sets the destination MAC address to the hardware address
of the original source device. It looks up in a table the hardware address of the
source, determines that device's IP address assignment, and puts it into the
destination IP address field.
5. RARP server sends RARP reply message: The RARP server sends the RARP reply
message to the device looking to be configured.
6. Source device processes RARP reply message: The source node processes the
reply from the RARP server. It then configures itself using the IP address in the
destination IP address supplied by the RARP server.

6.2.5 Issues with RARP


Problems with RARP include its use of a , most routers from
forwarding an RARP request and the minimal information returned (just the system’s IP
address).
While the RARP concept is simple, the implementation of an RARP server is
. Hence not all TCP/IP implementations provide an RARP server.
These days, RARP has not been used. It has been over taken by BOOTP (Bootstrap
Protocol) and DHCP (Dynamic Host Configuration Protocol). Both support a much
greater feature set than RARP.
The primary limitations of RARP are that each MAC must be manually configured on a
central server, and that the protocol only conveys an IP address. This leaves
configuration of subnetting, gateways, and other information to other protocols or the
user.
Another limitation of RARP compared to BOOTP or DHCP is that it is a non-IP protocol.
This means that like ARP it can't be handled by the TCP/IP stack on the client, but is
instead implemented separately.
In computing, BOOTP is a UDP network protocol used by a network client to obtain its
IP address automatically. This is usually done in the bootstrap process of computers or
operating systems running on them. The BOOTP servers assign the IP address from a
pool of addresses to each client.
Note: For DHCP, refer chapter.

Problems and Questions with Answers


Question 1: Assume the following Ethernet network exists:
Subnet-1 Subnet-2
C A

D Router

E B

The IP and MAC addresses for each host and the router are as follows:

6.2 Reverse Address Resolution Protocol [RARP] 168


Elements of Computer Networking ARP and RARP

Host IP Address MAC Address


Router 1 [Link] [Link]g:h
Router 1 [Link] [Link]
A [Link] i:j:k:l
B [Link] m:n:o:p
C [Link] q:r:s:t
D [Link] u:v:w:x
E [Link] y:z:a:b
Assuming the ARP table is fully populated, list the ARP table for host E.
: Host E only sees the other hosts on the [Link]/24 network (we are
ignoring TTL values):
Host IP Address MAC Address
C [Link] q:r:s:t
D [Link] u:v:w:x
Router 1 [Link] [Link]g:h
Question 2: For the Question 1, if E transmits an Ethernet frame to C, what are the
source and destination MAC and IP addresses?
:
Host IP Address MAC Address
Source (E) [Link] y:z:a:b
Destination (C) [Link] q:r:s:t
Question 3: For the Question 1, if C transmits a frame to host B, what are the source
and destination MAC and IP addresses when the frame leaves host C? When the
frame arrives at host B?
:
Leaving host C:
Host IP Address MAC Address
Source [Link] q:r:s:t
Destination [Link] [Link]
Arriving at host B:
Host IP Address MAC Address
Source (E) [Link] [Link]g:h
Destination (C) [Link] m:n:o:p
Question 4: What is the primary purpose of ARP?
A) translate URLs to IP addresses
B) resolve IPv4 addresses to MAC addresses
C) provide dynamic IP configuration to network devices
D) convert internal private addresses to external public addresses
:B
Question 5: What is the difference between ARP and RARP?
: ARP will resolve the MAC address of a device for which we know the IP address.
RARP will resolve the IP address of the device for which we know the MAC address.
Question 6: ARP is:
A) A layer 3 protocol that is used by layer 3
B) A layer 2 protocol that is used by layer 2
C) A layer 3 protocol that is used by layer 2
D) A layer 2 protocol that is used by layer 3
E) A layer 2 protocol that is used by layer 1
F) A layer 1 protocol that is used by layer 2
G) A layer 1 protocol that is used by layer 1
:D
6.2 Reverse Address Resolution Protocol [RARP] 169
Elements of Computer Networking IP Addressing

Chapter

IP Addressing 7
7.1 Introduction
Let us start our discussion with a basic question: What is a ? Well, a is
a set of communication rules used for connecting some computers in a network. As for
example a man goes to some different land and wants to find his destination. Then
there should be some standard pattern for such people to talk to each other or to
communicate. These standard patterns are some set of rules with which we need to
send our data to this distant land and talk to the person. Thus there is standard set of
protocols without which our communication is impossible for the Internet. These
are called .
Communication between hosts can happen only if they can identify each other on the
network. No doubt you have heard the term . Unless you are a techie, though,
you may not understanding of what an IP address actually is or how it works. Let's
explore the concept with real world scenarios.
The Internet is a global network connecting billions of devices. Each device uses a
to communicate with other devices on the network. These protocols govern
communication between all devices on the Internet.
In 1969, BBN Technologies started building the Interface Message Processors (IMPs) for
the ARPANET and an important piece of the network was missing: the software that
would govern how computers would communicate. Graduate students at various
facilities funded by the US Department of Defense Advanced Research Projects Agency
(DARPA) had been given the task in 1969 of developing the missing communication
protocols. They formed an informal . The students connected to
ARPANET, who had been given the task in 1969 of developing the technical protocols,
also began to establish the informal protocols that would influence interpersonal
communications on the Internet in general.
From 1973 to 1974, ′ networking research group at worked out details of
the idea, resulting in the first TCP specification. DARPA then contracted with BBN
Technologies, Stanford University, and the University College London to develop
operational versions of the protocol on different hardware platforms. Four versions were
developed: TCP v1, TCP v2, TCP v3 and IP v3, and TCP/IP v4.
In 1975, a two-network TCP/IP communications test was performed between Stanford
and University College London (UCL). In November, 1977, a three-network TCP/IP test

7.1 Introduction 170


Elements of Computer Networking IP Addressing

was conducted between sites in the US, the UK, and Norway. Several other TCP/IP
prototypes were developed at multiple research centers between 1978 and 1983.
Internet Protocol version 4 (IPv4), developed in 1981, currently controls the majority of
intranet and Internet communication. It was the first viable protocol to handle distance
computer communication. Predecessors had difficulty routing data over long distances
with high reliably. Many questions were answered by IPv4 that were unknown at the
time.
Over the next decade, the usefulness of IPv4 soon surfaced. IPv4’s predecessors fell
short of the requirements for large scale communication. IPv4 was developed by
Internet Engineering Task Force (IETF) in September 1981. When IP was first
standardized in September 1981, the specification required that each system attached
to an IP-based internet be assigned a unique, 32-bit Internet address value.

7.2 What is an IP Address?


Just like your home has a mailing address in the same way any computer or device
connected to the internet have a mailing address called the . IP
address is short for Internet Protocol (IP) address. An IP address is an identifier for a
computer or device on a TCP/IP network. Networks using the TCP/IP protocol route
messages based on the IP address of the destination.
An IP address is a 32-bit number written in decimal notation: four 8-bit fields
(octets) converted from binary to decimal numbers, separated by dots.
:
[Link]
[Link]
[Link]
An IP address can either be or . If it is static, then it will remain
unchanged every time we connect a node to a network and if it is dynamic then a local
DHCP (Dynamic Host Configuration Protocol) server grants a new IP address every time
we connect a node to internet.
Note: For more details on DHCP, refer chapter.

7.3 Understanding IP Address


As seen above, the 32 binary bits are divided into four octets (1 octet = 8 bits). Each
octet is converted to decimal and separated by a period (dot). For this reason, an IP
address is said to be expressed