Cs8591 Computer Networks 1103969345 CN Notes
Cs8591 Computer Networks 1103969345 CN Notes
PART A
2. What is the difference between a user agent (UA) and a mail transfer agent (MTA)?
The UA prepares the message, creates the envelope, and puts the message in the envelope. The MTA
transfers the mail across the Internet.
3. How doesMIME (Differ) enhance SMTP? (Nov/Dec 2007)(Or) State the difference between SMTP
and MIME (NOV/DEC 2014)
MIME is a supplementary protocol that allows non-ASCII data to be sent through SMTP. MIME
transforms non-ASCII data at the sender site to NVT ASCII data and deliverers it to the client SMTP to be
sent through the Internet. The server SMTP at the receiving side receives the NVT ASCII data and delivers it
to MIME to be transformed back to the original data.
1
CS8591 - COMPUTER NETWORKS
8. Define CGI?
CGI is a standard for communication between HTTP servers and executable programs. It is used in
crating dynamic documents.
9. What are the requests messages support SNMP and explain it?
GET
SET
The former is used to retrieve a piece of state from some node and the latter is used to store a new
piece of state in some node.
Response: Header, question records, answer records, authoritative records, and additional
records.
POP3 (Post Office Protocol 3) is the most recent version of a standard protocol for receiving e-mail. POP3 is
a client/serverprotocol in which e-mail is received and held for you by your Internet server. POP and IMAP
deal with the receiving of e-mail and are not to be confused with the Simple Mail Transfer Protocol (SMTP),
a protocol for transferring e-mail across the Internet.
IMAP (Internet Message Access Protocol) is a standard protocol for accessing e-mail from your local server.
IMAP (the latest version is IMAP Version 4) is a client/server protocol in which e-mail is received and held
for you by your Internet server.IMAP can be thought of as a remote file server. POP3 can be thought of as a
"store-and-forward" service.
2
CS8591 - COMPUTER NETWORKS
16. What is persistent HTTP?What are the advantages of allowing persistent TCP Connections in
HTTP?(May 2013) (Nov 2016)
HTTP persistent connection, also called HTTP keep-alive, or HTTP connection reuse, is the idea of using a
single TCP connection to send and receive multiple HTTP requests/responses, as opposed to opening a new
connection for every single request/response pair.
1. It is really, really hard to infer the input from the hash because there are an infinite amount of
input strings that will generate the same output (irreversible property).
2. However, finding even a single instance of multiple input strings that generate the same output is also
really, really hard (collision resistant property).
19. What DNS cache issues are involved in changing the IP address of a webServer host name?
Nov/Dec 2013
The Domain Name System supports DNS cache servers which store DNS query results for a period
of time determined in the configuration (time-to-live) of the domain name record in question. Typically,
such caching DNS servers, also called DNS caches, also implement the recursive algorithm necessary to
resolve a given name starting with the DNS root through to the authoritative name servers of the queried
domain. With this function implemented in the name server, user applications gain efficiency in design and
operation.
Application protocols govern various processes, such as the process for downloading a web page, or
for sending e-mail. The application protocol directs how these processes are done.
3
CS8591 - COMPUTER NETWORKS
4
CS8591 - COMPUTER NETWORKS
MIME, an acronym for Multipurpose Internet Mail Extensions, specifies how messages must be
formatted so that they can be exchanged between different email systems. MIME is a very flexible format,
permitting one to include virtually any type of file or document in an email message. MIME messages can
contain text, images, audio, video, or other application-specific data.
28. List down the key lengths supported by PGP (NOV/DEC 2014)
The "length" is a formal characterization of one of the mathematical values that constitute the key
pair. Thus, the public and the private key don't have independent lengths per se; the private/public key pair
has a length, which, by extension, is also said to be the length of the public key and of the private key.
The length is not the actual bit length of the encoding of either the public or private key, although there are
correlations
31. Mention the different levels in domain name space (May 2016)
Top Level Domains
Second Level Domails
Third Level Domails
34. Present the information contained in a DNS resource record? (Apr/May 2017)
A resource record is a name-to-value binding, a 5-tuple that contains the following fields:
Class: set to IN for internet information. For other information other codes may be specified.
Type: tells what kind of record it is.
Time to live: Upper Limit on the time to reach the destination
Value: can be an IP address, a string or a number depending on the record type.
HTTP (Hypertext Transfer Protocol) is the set of rules for transferring files (text, graphic images, sound,
video, and other multimedia files) on the World Wide Web. As soon as a Web user opens their Web browser,
the user is indirectly making use of HTTP. HTTP is an application protocol that runs on top of the TCP/IP
suite of protocols (the foundation protocols for the Internet).
The TELNET Protocol is built upon three main ideas: first, the concept of a "Network Virtual Terminal"; second,
the principle of negotiated options; and third, a symmetric view of terminals and processes.
6
CS8591 - COMPUTER NETWORKS
World Wide Web: The Web today is a repository of information in which the documents, called web
pages, are distributed all over the world and related documents are linked together
The purpose of the Web has gone beyond the simple retrieving of linked documents.
The WWW today is a distributed client-server service, in which a client using a browser can access a
service using a server. However, the service provided is distributed over many locations called sites. Each
site holds one or more web pages.
PART-B
Distribution allows the growth of the Web. Each web server in the world can add a new web page to the
repository and announce it to all Internet users without overloading a few servers. Linking allows one web
page to refer to another web page stored in another server somewhere else in the world. The linking of web
pages was achieved using a concept called hypertext
Architecture
The WWW today is a distributed client-server service, in which a client using a browser can access a service
using a server. However, the service provided is distributed over many locations called sites.
Each site holds one or more web pages. Each web page, however, can contain some links to other
web pages in the same or other sites. In other words, a web page can be simple or composite. A simple web
page has no links to other web pages; a composite web page has one or more links to other web pages. Each
web page is a file with a name and address.
The controller receives input from the keyboard or the mouse and uses the client programs to access
the document. After the document has been accessed, the controller uses one of the interpreters to display the
document on the screen. The client protocol can be one of the protocols described later, such as HTTP or
7
CS8591 - COMPUTER NETWORKS
FTP. The interpreter can be HTML, Java, or JavaScript, depending on the type of document. Some
commercial browsers include Internet Explorer, Netscape Navigator, and Firefox
Web Server
The web page is stored at the server. Each time a request arrives, the corresponding document is sent
to the client. To improve efficiency, servers normally store requested files in a cache in memory; memory is
faster to access than a disk. A server can also become more efficient through multithreading or
multiprocessing. In this case, a server can answer more than one request at a time. Some popular web servers
include Apache and Microsoft Internet Information Server
❑ Protocol. The first identifier is the abbreviation for the client-server program that we need in order to
access the web page. Although most of the time the protocol is HTTP (HyperText Transfer Protocol), we can
also use other protocols such as FTP (File Transfer Protocol).
❑ Host. The host identifier can be the IP address of the server or the unique name given to the server. IP
addresses can be defined in dotted decimal notation, (such as 64.23.56.17); the name is normally the domain
name that uniquely defines the host, such as forouzan.com
❑ Port. The port, a 16-bit integer, is normally predefined for the client-server application. For example, if the
HTTP protocol is used for accessing the web page, the well-known port number is 80. However, if a different
port is used, the number can be explicitly given.
❑ Path. The path identifies the location and the name of the file in the underlying operating system. The
format of this identifier normally depends on the operating system. In UNIX, a path is a set of directory
names followed by the file name, all separated by a slash. For example, /top/next/last/myfile is a path that
uniquely defines a file named myfile, stored in the directory last, which itself is part of the directory next,
which itself is under the directory top.
To combine these four pieces together, the uniform resource locator (URL) has been designed; it uses three
different separators between the four pieces as shown below:
Web Documents
The documents in the WWW can be grouped into three broad categories: static, dynamic, and active.
Static Documents
Static documents are fixed-content documents that are created and stored in a server. The client can get a
copy of the document only. Languages used: HTML, XML, XSL, XHTML
Dynamic Documents
8
CS8591 - COMPUTER NETWORKS
A dynamic document is created by a web server whenever a browser requests the document. When a
request arrives, the web server runs an application program or a script that creates the dynamic document.
The server returns the result of the program or script as a response to the browser that requested the
document. Languages used: JSP, ASP
\
Active Documents
For many applications, we need a program or a script to be run at the client site. These are called active
documents. Use java applets
2. Explain working of E-mail, describe how SMTP is used E-mail application in detail?
(Apr/may 2011& 2010, Nov/Dec 2013) (Nov 2015)
The model that works best for email is the Client-Server model.
Clients carry out user interactions with the email server.
Forms in which clients appear:
Application based - these are installed onto user’s machines and include Microsoft Outlook
and the freely available Outlook Express and Eudora.
Web based - these appear in a web browser’s window and include Hotmail, Yahoo and
Outlook web client.
Basic functions include: (Services)
Ability to create new emails.
Display and store received emails.
Hold address lists of contacts, a calendar, journal and other extra functions that help organize
the user’s working day.
The client is also configured with the account information and names or IP addresses of the
email servers with which it will be communicating.
An email server is typically a combination of processes running on a server with a large storage
capacity it includes a list of users and rules, and the capability to receive, send and store emails and
attachments.
Should process emails for months as sending, receiving and maintenance tasks are carried out at
scheduled times. The client only has to connect to the email server when it sends and checks/receives
new email.
Sometimes it may be permanently connected to the server to allow access to shared address books or
calendar information – this is typical of a LAN-based email server.
Most email servers conduct email services by running two separate processes on the same machine.
9
CS8591 - COMPUTER NETWORKS
One process is the POP3 (Post Office protocol 3) server, which holds emails in a queue and delivers
emails to the client when they are requested.
The other is the SMTP (simple mail transfer protocol) server that receives outgoing emails from
clients and sends and receives email from other SMTP servers.
These two processes are linked by an internal mail delivery mechanism that moves mail between the
POP3 and SMTP servers.
When the client calls the email server to send or check for mail it connects to the server on certain
TCP/IP ports:
SMTP on port 25
POP3 on port 110.
MAIL PROTOCOLS
SMTP - Simple Mail Transport Protocol is used on the internet, it is not a transport layer protocol but
is an application layer protocol.
POP3 - Post Office Protocol version 3 is used by clients to access an internet mail server to get mail.
It is not a transport layer protocol.
IMAP4 - Internet Mail Access Protocol version 4 is the replacement for POP3.
MIME - Multipurpose Internet Mail Extension is the protocol that defines the way files are attached
to SMTP messages.
3.Explain the salient features of the SMTP protocol (Email protocols) (12)(MAY/JUNE 2009)
SMTP protocol (May 2015& 2016, Apr/May 2017)
Simple Mail Transfer Protocol (SMTP) is used to send mail across the internet. This protocol
transfers electronic mail (e-mail ) from the mail server of a source to the mail servers of destinations.
The mail is enclosed in what is called an envelope. The envelope contains the TO and FROM fields
and these are followed by the mail. The mail consists of two parts namely the Header and the Data.
The Header has the TO and FROM fields.
In SMTP data portion can contain only printable ASCII characters. The old method of sending a
binary file was to send it in uuencoded form but there was no way to distinguish between the many
types of binary files possible eg. .tar, .gz , .dvi etc.
There are four types of programs used in the process of sending and receiving mail. They are:
MUA - Mail users agent. This is the program a user will use to type e-mail. It usually incorporates an
editor for support. The user types the mail and it is passed to the sending MTA.
10
CS8591 - COMPUTER NETWORKS
MTA - Message transfer agent is used to pass mail from the sending machine to the receiving
machine. There is a MTA program running on both the sending and receiving machine.
LDA - Local delivery agent on the receiving machine receives the mail from its MTA.
Mail notifier - This program notifies the recipient that they have mail.
Example
11
CS8591 - COMPUTER NETWORKS
Responses
Responses are sent from the server to the client. A response is a three digit code that may be followed by
additional textual information.
12
CS8591 - COMPUTER NETWORKS
13
CS8591 - COMPUTER NETWORKS
MIME, an acronym for Multipurpose Internet Mail Extensions, specifies how messages must be formatted so
that they can be exchanged between different email systems. MIME is a very flexible format, permitting one
to include virtually any type of file or document in an email message. MIME messages can contain text,
images, audio, video, or other application-specific data. Specifically, MIME allows mail messages to
contain:
A secure version of MIME, S/MIME (Secure/Multipurpose Internet Mail Extensions), is defined to support
encryption of email messages. Based on the MIME standard, S/MIME provides the following cryptographic
security services for electronic messaging applications: authentication, message integrity and non-repudiation
of origin and privacy and data security.
MIME standard converts (encodes) non-text files into text that is normally unreadable and then, at the other
end, reconverts (decodes) the files to their originalform.
The Content-Description: header is an ASCII string telling what is in the message. This header is needed so
the recipient will know whether it is worth decoding and reading the message.
The Content-Transfer-Encoding: tells how the body is wrapped for transmission through a network that
may object to most characters other than letters, numbers, and punctuation marks.
Content-Type: It specifies the nature of the message body. Seven types are defined in RFC 2045, each of
which has one or more subtypes. The type and subtype are separated by a slash, as in Content-Type:
video/mpeg
14
CS8591 - COMPUTER NETWORKS
IMAP can do all three modes: offline, online processing and disconnected operations. In the online
mode, the mail client does not copy mails in a shared server all at once and then delete them. It is an
interactive client-server model, where the client can ask the server for headers, or the bodies of
specified messages, or to search for messages meeting certain criteria.
IMAP includes operations for creating, deleting, and renaming mailboxes; checking for new
messages; permanently removing messages; setting and clearing flags; server-based and MIME
parsing, and searching; and selective fetching of message attributes, texts, and portions thereof for
efficiency. IMAP allows clients to access messages (both new and saved) from more than one
computer, that feature has become extremely important as reliance on electronic messaging and use
of multiple computers increase.
The current version of IMAP is version 4 revision 1(IMAP4 rev1). Key features for IMAP4 include:
15
CS8591 - COMPUTER NETWORKS
store-and-forward service, intended to move mail (on demand) from the mail server (drop point) to a
single destination machine, usually a PC or Mac. Once delivered to the PC or Mac, the messages are
then deleted from the mail server.
Once the connection is established, the POP3 protocol goes through three states in sequence:
Authorization - The authorization state deals with having the user log in.
Transactions - The transaction state deals with the user collecting the e-mails and
marking them for deletion from the mailbox.
Update – The update state actually causes the e-mails to be deleted
Command Description
USER This command makes it possible to be authenticated. It must be followed by the user
identificatio name, i.e. a character string identifying the user on the server. The USER command
n must precede the PASS command.
PASS The PASS command makes it possible to specify the user's password where the name
password has been specified by a prior USER command.
STAT Information on the messages contained on the server
RETR Number of the message to be picked up
DELE Number of the message to be deleted
LIST [msg] Number of the message to be displayed
NOOP Allows the connection to be kept open in the event of inactivity
TOP Command displaying n lines of the message, where the number is given in the
<messageID argument. In the event of a positive response from the server, it will send back the
><n> message headers, then a blank line and finally the first n lines of the message.
UIDL [msg] Request to the server to send back a line containing information about the message
possibly given in the argument. This line contains a character string called a unique
identifier listing, making it possible to uniquely identify the message on the server,
independently of the session. The optional argument is a number relating to a message
existing on the POP server, i.e. an undeleted message).
QUIT The QUIT command requests exit from the POP3 server. It leads to the deletion of all
messages marked as deleted and sends back the status of this action.
17
CS8591 - COMPUTER NETWORKS
6. i) What is HTTP protocol used for? (OR) Write notes on URLS(NOV/DEC 2014) (Nov 2015)
(May 2016)
ii) What is the default port number of HTTP protocol?
iii) Discuss the features of HTTP and also discuss how HTTP works.
HTTP PROTOCOL
The HyperText Transfer Protocol (HTTP) is used to define how the client-server programs can be
written to retrieve web pages from the Web. An HTTP client sends a request; an HTTP server returns a
response. The server uses the port number 80; the client uses a temporary port number.
Protocol for transfer of data between Web servers and Web clients (browsers).
“The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed,
collaborative, hypermedia information systems.
Popular Web servers:
Apache HTTPD, JBoss and Tomcat
Popular Web clients:
Firefox and Opera
HTTP Properties
1) A comprehensive addressing scheme
18
CS8591 - COMPUTER NETWORKS
The HTTP protocol uses the concept of reference provided by the Universal Resource Identifier
(URI) as a location (URL) or name (URN), for indicating the resource on which a method is to be applied.
Every resource accessible through HTTP is identified by a Uniform Resource Location (URL), which
is a location-specific identifier.
For example,
– http://www.cs.uct.ac.za:80/
– ftp://ftp.cs.uct.ac.za/
A Uniform Resource Identifier (URI) is a standard format (<scheme>:<identifier>) generic identifier.
For example,
– mailto:[email protected]
A Uniform Resource Name (URN) is one example of a location-independent URI.
For example urn:isbn:123-456-789
2) Client-Server architecture
The HTTP protocol is based on a request/response paradigm. The communication generally takes
place over a TCP/IP connection on the Internet. The default port is 80, but other ports can be used. A
requesting program (a client) establishes a connection with a receiving program (a server) and sends a
request to the server in the form of a request method, URI, and protocol version, followed by a message
containing request modifiers, client information, and possible body content. The server responds with a status
line, including its protocol version and a success or error code, followed by a message containing server
information, entity meta_information, and possible body content.
19
CS8591 - COMPUTER NETWORKS
Caching
The goal of caching in HTTP is to eliminate the need to send requests in many cases, and to eliminate the
need to send full responses in many other cases. That is, there are two main reasons that web caching is used:
To reduce latency because the request is satisfied from the cache (which is closer to the client) instead
of the origin server, it takes less time for the client to get the object and display it. This makes Web
sites seem more responsive.
To reduce traffic because each object is only gotten from the server once, it reduces the amount of
bandwidth used by a client. This saves money if the client is paying by traffic, and keeps their
bandwidth requirements lower and more manageable.
Nonpersistent versus Persistent Connections
Nonpersistent Connections
Persistent Connections
HTTP version 1.1 specifies a persistent connection by default. In a persistent connection, the server leaves
the connection open for more requests after sending a response. The server can close the connection at the
request of a client or if a time-out has been reached. The sender usually sends the length of the data with each
response.
Message Formats
The HTTP protocol defines the format of the request and response messages
Request Message
HTTP Methods
HTTP allows an open-ended set of methods to be used to indicate the purpose of a request. The three most
often used methods are GET, HEAD, and POST.
20
CS8591 - COMPUTER NETWORKS
Method Description
OPTIONS capabilities of resource/server
GET retrieve resource
HEAD retrieve headers for resource
POST submit data to server
PUT replace/insert resource on server
DELETE remove resource from server
TRACE trace request route through Web
OPTION The OPTIONS method provides a way for the client to query the server about its properties or
those of a specific file. Telling whether the request was satisfied, and if not, why not.
21
CS8591 - COMPUTER NETWORKS
An HTTP transaction consists of a header followed optionally by an empty line and some data. The header
will specify such things as the action required of the server, or the type of data being returned, or a status
code. The use of header fields sent in HTTP transactions gives the protocol great flexibility. These fields
allow descriptive information to be sent in the transaction, enabling authentication, encryption, and/or user
identification. The header is a block of data preceding the actual data, and is often referred to as meta
information, because it is information about information.
Accept: Indicates which data formats are acceptable.
– Accept: text/html, text/plain
HTTP_User-Agent.
The browser the client is using to send the request.
General format: software/version library/version.
Content-Language: Language of the content
– Content-Language: english
Content-Length: Size of message body
– Content-Length: 1234
Content-Type: MIME type of content body
– Content-Type: text/html
22
CS8591 - COMPUTER NETWORKS
Date: The Date header represents the date and time at which the message was originated
– Date: Tue, 15 Nov 1994 08:12:31 GMT
Expires: When content is no longer valid
– Expires: Tue, 15 Nov 1994 08:12:31 GMT
Host: Machine that request is directed to
– Host: www.cs.uct.ac.za
Location:
The Location response header field defines the exact location of the resource that was identified by
the request URI. If the value is a full URL, the server returns a "redirect" to the client to retrieve the
specified object directly.
– Location: http://myserver.org/
Response Message
23
CS8591 - COMPUTER NETWORKS
A response message consists of a status line, header lines, a blank line, and sometimes a body. The
first line in a response message is called the status line. There are three fields in this line separated by spaces
and terminated by a carriage return and line feed
7.Discuss briefly DNS (Domain Name System)& its advantages (Apr /may2010) (Nov/Dec
2014)(Nov 2015 & 2016)(Apr/May 2017)
The DNS translates Internet domain and host names to IP addresses. DNS automatically converts the names
we type in our Web browser address bar to the IP addresses of Web servers hosting those sites.
24
CS8591 - COMPUTER NETWORKS
3. Each computer, after being booted, knows the address of one DNS server. The DNS client sends a
message to a DNS server with a query that gives the file transfer server name using the known IP address of
the DNS server.
4. The DNS server responds with the IP address of the desired file transfer server.
5. The DNS server passes the IP address to the file transfer client.
6. The file transfer client now uses the received IP address to access the file transfer server.
Namespace:
The names assigned to computers must be selected from a name space. The name must be unique because
the addresses are unique. A namespace that maps each address to a unique name can organize in two ways.
1. Flat Namespace
2. Hierarchical Namespace
Flat Namespace A name is assigned to an address. A name in this space is a sequence of characters without
structure. The main disadvantage of flat namespace is that, it cannot use in a large system such as the
internet.
Hierarchical NamespaceEach name is made of several parts. The first part can defined the nature of the
organization, the second part can defined the name, and the third part can define department and so on. The
authority to assign and control the namespaces can be decentralized.
Domain Hierarchy:
DNS is hierarchical in structure. A domain is a subtree of the domain name space. All the related
information about a particular network (generally maintained by an organization, firm or university) should
be available at one place. The organization should have complete control over what it includes in its network
and how does it "organize" its network. Meanwhile, all this information should be available transparently to
the outside world.
Conceptually, the internet is divide into several hundred top level domains where each domain covers
many hosts. Each domain is partitioned in subdomains which may be further partitioned into subsubdomains
and so on... So the domain space is partitioned in a tree like structure as shown below.
The internet uses a hierarchical tree structure of Domain Name Servers for IP address resolution of a host
name.
25
CS8591 - COMPUTER NETWORKS
The top level domains are either generic or names of countries. eg of generic top level domains are .edu .mil
.gov .org .net .com .int etc. For countries we have one entry for each country as defined in ISO3166. eg. .in
(India) .uk (United Kingdom).
The leaf nodes of this tree are target machines. Obviously we would have to ensure that the names in a row in
a subdomain are unique. The max length of any name between two dots can be 63 characters. The absolute
address should not be more than 255 characters. Domain names are case insensitive. Also in a name only
letters, digits and hyphen are allowed. For eg. www.iitk.ac.in is a domain name corresponding to a machine
named www under the sub domain iitk.ac.in.
Domain Name
A name that identifies one or more IP addresses. For example, the domain name microsoft.com represents
about a dozen IP addresses. Domain names are used in URLs to identify particular Web pages. For example,
in the URL http://www.pcwebopedia.com/index.html, the domain name is pcwebopedia.com.
1. FQDN: A fully qualified domain name (FQDN) consists of the host name plus domain name. e.g.
computername.domain.com
2. PQDN: A partially Qualified Domain Name (PQDN) stats from a node, but it does not reach the
root. E.g. computername
1. Resolver
2. Name server
3. Database of Resource Records(RRs)
Resolver: A host that needs to map an address to a name or a name to an address calls a DNS client called a
resolver. The resolver accesses the closest DNS server with a mapping request. If the server has the
information, its satisfies the resolver; after the resolver receives the mapping, it interprets the response to see
if it’s a real resolution or an error, and finally delivers the result to the process that requested it.
26
CS8591 - COMPUTER NETWORKS
and response. When the query is finally resolved, the response travel back until it finally reaches the
requesting client. This is called recursive resolution.
v) Caching
Each time a server receives a query for a name that is not in its domain, it needs to search its database for
a server IP address. Reduction of this time put increase efficiency. When a server asks for a mapping
from another server and receives the response, it stores this information in its cache memory before
sending it to the client. If the same or another client asks for the same mapping, it can check its cache
memory and solve the problem. This mechanism is called caching.
Name Servers
The first step is to partition the hierarchy into sub trees called zones. Each zone can be thought of a
corresponding to some administrative authority that is responsible for that portion of the hierarchy.
DNS server is used to distribute the information among many computers. Specifically, the
information contained in each zone is implemented in two or more name servers for the sake of
redundancy, that is, the information is still available even if one name server fails. Each name server,
in turn, is a program that can be accessed over the Internet.
Client send queries to name servers, and name servers respond with the requested information.
Sometimes the response contains the final answer that the client wants, and sometimes the response
contains a pointer to another server that the client should query next.
27
CS8591 - COMPUTER NETWORKS
1. Root Server :A root server is a server whose zone consist of the whole tree. A root server usually
does not store any information about domains. But delegates it’s authority to other servers, keeping
references to those servers.
2. Primary Server: A Primary server is a server that stores a file about the zone for which it is an
authority. It is responsible for creating, maintaining and updating the zone file. It stores the zone file
on a local disk.
3. Secondary Server: A secondary server transfers the complete information about a zone from another
server and stores the file on its local disk. The secondary server neither creates nor updates the zone
files. If updating is required it must be done by the primary server, which sends the updated version
to the secondary. When the secondary downloads information from the primary it is called zone
transfer.
Types of Records
Resource
Record Type Contents Use
A Host Address Used to hold a specific host's IP address.
CNAME Canonical Name Used to make an alias name for a host.
(alias)
MX Mail Exchanger Provides message routing to a mail server, plus backup server(s) in case
the target server isn't active.
28
CS8591 - COMPUTER NETWORKS
SOA Start of Used to determine the DNS server that's the primary server for a DNS
Authority zone and to store other zone property information.
DNS Messages
To retrieve information about hosts, DNS uses two types of messages: query and response. Both types have
the same format
DDNS
When the DNS was designed, no one predicted that there would be so many address changes. In
DNS, when there is a change, such as adding a new host, removing a host, or changing an IP address, the
change must be made to the DNS master file. These types of changes involve a lot of manual updating. The
size of today’s Internet does not allow for this kind of manual operation The DNS master file must be
updated dynamically.
The Dynamic Domain Name System (DDNS) therefore was devised to respond to this need. In
DDNS, when a binding between a name and an address is determined, the information is sent, usually by
DHCP to a primary DNS server To provide security and prevent unauthorized changes in the DNS records,
DDNS can use an authentication mechanism.
Advantages:
Faster: DNS are connected well at intersections of internet. Anycast technology enables requests are
answered to the next closest node in the case of maintenance or downtime.
29
CS8591 - COMPUTER NETWORKS
SNMP is a frame work for managing devices in an internet using TCP/IP suite. It provides fundamental
operations for monitoring and maintaining an internet.
Concept:
SNMP uses the concept of manager and agent. Manager usually a host controls and monitors a set of
agents, usually routers. A management station, called a manager, is a host that runs the SNMP client
program. A managed station, called an agent, is a router or host that runs the SNMP server program.
Management is achieved through simple interaction between a manager and an agent. The agent
keeps performance information in a database. The manager has access to the values in the database.
Management Components
To do management tasks, SNMP uses two other protocols: Structure of Management Information
(SMI) and Management Information Base (MIB). In other words, management on the Internet is done
through the cooperation of three protocols: SNMP, SMI, and MIB
30
CS8591 - COMPUTER NETWORKS
Role of SNMP
SNMP has some very specific roles in network management. It defines the format of the packet to be send
from a manager to an agent and vice versa. It also interprets the result and creates statistics. The packet
exchange contains the object names (variables) and their status (values). SNMP is response for reading and
changing these values.
Role of SMI
SMI defines the general rules for naming objects, defining object types (including range and length), and
showing how to encode objects and values.
Role of MIB
MIB creates a collection of named objects, their types, and their relationships to each other in an entity to be
managed
PDU’s
SNMP V3 defines 8 types of packets
31
CS8591 - COMPUTER NETWORKS
Types of errors:
Non Repeater: This field is used only in get-bulk-request and replaces the error status field which is
empty in request PDU’s.
Error Index: Error index is an offset that tells the manager which variable caused the error.
Max-repetition: This field is also used only in get-bulk-request and replaces the error index filed,
which is empty in request PDU’s
VarBind List: This is a set of variables with corresponding values the manager wants to retrieve or set.
The values or null in get-request and get-next-request.
SNMP messages:
SNMP does not send only a PDU, it embeds the PDU in a message. A message in SNMPv3 is
made of four elements: version, header, security parameter and data.
The version, defines the current version (3)
The header contains values for message identification, maximum message size, message flag
and a message security model.
The message security parameter is used to create a message digest.
The data contain the PDU. If the data are encrypted, there is information about the
encrypting engine and the encrypting context followed by the encrypted PDU. If the data are
not encrypted, the data consist of just the PDU.
32
CS8591 - COMPUTER NETWORKS
UDP Ports:
SNMP uses the services of UDP on two well-known ports, 161 and 162. The well-known port 161 is used
by the server (agent), and the well-known port 162 is used by the client (Manager).
Security:
SNMPv3 provides two types of security: general and specific.
SNMPv3 provides message authentication, privacy, and manager authorization.
SNMPv3 allows a manager remotely change the security configuration, which means that the
manager does not have to be physically present at the manager station.
TELNET is an abbreviation for TErminaL NETwork. TELNET enables the establishment of a connection to
a remote system in such a way that the local terminal appears to be a terminal at the remote system.
TELNET general purpose client server application program.
Using the Telnet protocol user on a local host can remote-login and execute commands on another distant
host
Time sharing environment:
TELNET was designed at a time when most operating systems, such as UNIX, were operating in a time
sharing environment. In this environment, a large computer supports multiple users. The interaction
between a user and the computer occurs through a terminal, which is usually a combination of keyboard,
monitor and mouse.
Logging:
In a time sharing environment, users are the part of the system with some rights to access the resources. To
access the system, the authorized user logs in to the system with a user id or login name. This system also
includes password checking to prevent an unauthorized users from accessing the resources.
33
CS8591 - COMPUTER NETWORKS
When a user logs into a local timesharing system, it is called local log-in. As a user types at a
terminal the keystrokes are accepted by the terminal deriver. The terminal driver passes the
characters to the operating system. The operating system, in turn, interprets the combination of
characters and invokes the desired application program or utility.
When a user wants to access an application program or utility located on a remote machine, she
performs remote log-in. Here the TELNET client and server programs come into use. The user sends
the keystrokes to the terminal driver, where the local operating system accepts the characters but does
not interpret them. The characters are sent to the TELNET client, which transforms the characters to
a universal character set called network virtual terminal (NVT) characters and delivers them to the
local TCP/IP protocol stack.
The commands or text, in NVT form, travel through the Internet and arrive at the TCP/IP stack at the
remote machine. Here the characters are delivered to the operating system and passed to the
TELNET server, which changes the characters to the corresponding characters understandable by the
remote computer. However, the characters cannot be passed directly to the operating system because
34
CS8591 - COMPUTER NETWORKS
the remote operating system is not designed to receive characters from a TELNET server: It is
designed to receive characters from a terminal driver. The solution is to add a piece of software
called a pseudo terminal driver which pretends that the characters are coming from a terminal. The
operating system then passes the characters to the appropriate application program.
Network Virtual Terminal (NVT):
Network Virtual Terminal, which transforms the characters to a universal character set and delivers them to
the local TCP/IP stack.
NVT uses two sets of characters one for data and other for control.
NVT generally use the 8 bit character set for both.
NVT’s data character set is the US ASCII 7-bit code.
NVT can handle the printable characters with ASCII codes 32-126 plus a small set of control
characters:
Embedding:
TELNET uses only one TCP connection. The same connection is used for sending both data and control
characters. TELNET accomplishes this by embedding the control characters in the data stream. However, to
35
CS8591 - COMPUTER NETWORKS
distinguish data from control characters, each sequence of control characters is preceded by a special control
character called interpret as control (IAC).
Options:
TELNET lets the client and server negotiate options before or during the use of service. Options are extra
features available to a user with a more sophisticated terminal. Some common options:
Code Option Meaning
0 Binary Interpret as 8-bit transmission
1 Echo Echo the data received on one side to the other
3 Suppress go ahead Suppress go-ahead signals after data
5 Status Request the status of TELNET
6 Timing mark Define the timing marks
24 Terminal type Set the terminal type
32 Terminal speed Set the terminal speed.
34 Line mode Change to line mode
Option Negotiation:
To use any of the options mentioned in the previous section first requires option negotiation between the
client and the server. In this four control character are used
Mode of operation:
TELNET implementations operate in one of three modes. Default mode, Character mode, or Line mode.
Default Mode:
The default mode is used if no other modes are invoked through option negotiation. In this mode the echoing
is done by the client. The user types a character, and the client echoes the character on the screen, but does
not send it until a whole line is completed.
36
CS8591 - COMPUTER NETWORKS
Character Mode:
In the character mode, each character typed is send by the client to the server. The server normally echoes
the character back to be displayed on the client screen. In this mode the echoing of the character can be
delayed with the transmission time is long.
Line Mode:
A new mode has been proposed to compensate for the deficiencies of the default mode and character mode.
In this mode line editing is done by the client. The client then sends the whole line to the server.
10.Discuss the various commands used in FTP (12) (MAY/JUNE 2009) (or) Discuss FTP with suitable
diagram (Apr /may2011) (8)
The control connection remains, connected during the entire interactive FTP session.
The data connection is opened and then closed for each file transferred.
File Type:
FTP can transfer one of the following file types across the data connection: an ASCII file, EBCDIC file or
IMAGE file.
The ASCII file is the default format for transferring text files. Each character is encoded using 7-bit
ASCII.
A file can be transferred using EBCDIC file. Abbreviation of Extended Binary-Coded Decimal
Interchange Code. EBCDIC is an IBM code for representing characters as numbers.
The IMAGE file is the default format for transferring binary files.
Data Structure:
FTP can transfer a file across the data connection by using one of the following interpretations about the
structure of the data: file structure, record structure and page structure.
In the file structure format, the file is a continuous stream of bytes.
In the record structure format, the file is divided in to records. This can be used only with text files.
In the page structure format, the file is divided into pages, with each page having a page number and
a page header. The pages can be stored and accessed randomly and sequentially.
Transmission Mode:
FTP can transfer a file across the data connection by using one of the following three transmission modes:
stream mode, block mode and compressed mode.
In stream mode, the data are delivered from FTP to TCP as a continuous stream of bytes. TCP is
responsible for chopping data into segments of appropriate sizes. If the data are divided in to records, each
record will have a one byte end of record (EOR) character and end of the file will have a one byte EOF
character.
In block mode, the data can delivered from FTP to TCP blocks; in this case each block is preceded by a
three byte header. The first byte is called the block descriptor; the next two bytes define the size of the block
in bytes.
In the compressed mode, if the file is big the data can be compressed. The compressed method normally
used is run length encoding. In this method, consecutive appearances of a data unit are replaced by one
occurrence and the no of repetitions. In a text file this is usually spaces. In a binary null characters are
compressed.
38
CS8591 - COMPUTER NETWORKS
FTP Commands
Every FTP command generates at least one response. A response has two parts: a three-digit
number followed by text. The numeric part defines the code; the text part defines needed
parameters or further explanations. The first digit defines the status of the command. The second
digit defines the area in which the status applies. The third digit provides additional information.
39
CS8591 - COMPUTER NETWORKS
Security in networking is based on cryptography (secret writing), the science and art of transforming
messages to make them secure and immune to attack. Cryptography can provide confidentiality, integrity,
authentication and non repudiation of messages.
Message confidentiality: Message confidentiality or privacy means that the sender and receiver
expect confidentiality. The transmitted message must make sense to only the intended receiver. To
all others, the message must be garbage.
Message integrity: Message integrity means that the data must arrive at the receiver exactly as they
were sent. There must be no changes during the transmission, neither accidently nor maliciously.
Message Authentication: Message authentication is a service beyond message integrity. In message
authentication the receiver needs to be sure of the sender’s identity and that an imposter has not sent
the message.
Message Non repudiation: Message Non repudiation means that a sender must not be able to deny
sending a message that he or she did sent. The burden of proof falls on the receiver.
Entity Authentication: In entity authentication or user authentication, the entity or user is verified prior to
access to the system resources.
SSH is most often used to provide strong client/server authentication—where the SSH client runs on
the user’s desktop machine and the SSH server runs on some remote machine that the user wants to
log into—but it also supports message integrity and confidentiality. Telnet and rlogin provide none of
these capabilities.
SSH provides a way to encrypt the data sent over these connections and to improve the strength of the
authentication mechanism they use to login.
41
CS8591 - COMPUTER NETWORKS
16 MARKS
1. Write notes on URLS (16) (Q.NO 4)
2. (i) Discuss the advantages of DNS (8) (Q.NO 6)
(ii) Explain Telnet in detail (8) (Q.NO 9)
16 MARKS
1. .i.Explain the message transfer using Simple Mail Transfer Protocol.(8) (Q.NO 2)
ii.Explain the final delivery of email to the end user using POP3.(8) (Q.NO 4)
2.Write short notes on. i.Web services (Q.NO 8) ii.SNMP(Q.NO 7)
16 MARKS
1. Explain in detail about domain name system (Q.NO 6)
2. Write short notes onEmail&HTTP (Q.NO 1 &5)
16 MARKS
1. a)Describe how SMTP protocol is used in E-mail applications. (Q.NO1,2)
b) Explain HTTP with an example (Q.NO 5)
2. Explain in detail about Web service architecture (Q.NO 8)
2 MARKS
43
CS8591 - COMPUTER NETWORKS
PART B
1. i) Describe how SMTP transfer message from one host to another with suitable illustration?(Q.No 2)
ii) Explain IMAP with its state transition diagram.?(Q.No 4)
2. i) What is Domain Name System(DNS)?Explain(Q.No 6 )
ii) Brief about the importance of Simple Network Management Protocol(SNMP) (Q.No 7)
B.E/B.TechNov-Dec 2017
PART A
PART B
1. i) Explain the functions of IMAP with a state transition diagram. (Q.No 4)
ii) List and Explain the various HTTP request operations (Q.No 5)
2. i)List the element of network management and explain the operation of SNMP protocol in detail? (Q.No 7)
ii) Discuss the function performed by of DNS . Give example. (Q.No6)
44
CS8591 - COMPUTER NETWORKS
45
CS8591 - COMPUTER NETWORKS
46
CS8591 - COMPUTER NETWORKS
47
CS8591 - COMPUTER NETWORKS
48
CS8591 - COMPUTER NETWORKS
49
CS8591 - COMPUTER NETWORKS
50
CS8591 - COMPUTER NETWORKS
51
CS8591 - COMPUTER NETWORKS
52
CS8591 - COMPUTER NETWORKS
53
CS8591 - COMPUTER NETWORKS
2 Marks
2) What is the difference between TCP & UDP? (NOV 2014 & 2016)
TCP UDP
5) Define jitter
Jitter is the variation in delay for packets belonging to the same flow.
Example: 2ms delay for 1st packet
60ms delay for second packet.
Jitter is the VARIATION in delay over time from point-to-point. If the delay of transmissions
varies too widely in a VoIP call, the call quality is greatly degraded. The amount of jitter
tolerable on the network is affected by the depth of the jitter buffer on the network equipment in
the voice path. The more jitter buffer available, the more the network can reduce the effects of
jitter.
2
CS8591 - COMPUTER NETWORKS
Scheduling
3
CS8591 - COMPUTER NETWORKS
Traffic shaping
Admission control
Resource reservation
27. What is the difference between service point address, logical address and physical
address? Service point addressing Logical addressing Physical addressing
The transport layer header If a packet passes the If the frames are to be
includes a type of address network boundary we need distributed to different
called a service point another addressing to systems on the network, the
address or port address, differentiate the source and data link layer adds the
which makes a data delivery destination systems. The header, which defines the
from a specific process on network layer adds a source machine’ s address
one computer to a specific header, which indicate the and the destination
process on another logical address of the sender Machine’ s address.
computer. and receiver.
4
CS8591 - COMPUTER NETWORKS
32. What is meant by quality of service or QoS? (NOV 2014 & 2015)
The quality of service defines a set of attributes related to the performance of the connection. For
each connection, the user can request a particular attribute each service class is associated with a
set of attributes.
35. Why is UDP pseudo header included in UDP checksum calculation? What is the effect of
an invalid checksum at the receiving UDP?
The UDP checksum is performed over the entire payload, and the other fields in the header, and
some fields from the IP header. A pseudo-header is constructed from the IP header in order to
perform the calculation (which is done over this pseudo-header, the UDP header and the
payload). The reason the pseudo-header is included is to catch packets that have been routed to
the wrong IP address.
If the checksum validation is enabled and it detected an invalid checksum, features like packet
reassembling won't be processed.
36. How can the effect of jitter be compensated? What type of application require for this
compensation?
Jitter is an undesirable effect caused by the inherent tendencies of TCP/IP networks and
components.
Jitter is defined as a variation in the delay of received packets. The sending side transmits \
packets in a continuous stream and spaces them evenly apart. Because of network congestion,
improper queuing, or configuration errors, the delay between packets can vary instead of
remaining constant. This variation causes problems for audio playback at the receiving end.
Playback may experience gaps while waiting for the arrival of variable delayed packets.
When a router receives an audio stream for VoIP, it must compensate for any jitter that it detects.
The playout delay buffer mechanism handles this function. Playout delay is the amount of time
that elapses between the time a voice packet is received at the jitter buffer on the DSP and the
time a voice packet is played out to the codec.
5
CS8591 - COMPUTER NETWORKS
The playout delay buffer must buffer these packets and then play them out in a steady Stream to
the DSPs. The DSPs then convert the packets back into an analog audio stream. The play out
delay buffer is also referred to as the dejitter buffer.
Process can directly identify each other with an OS-assigned process ID(pid) More commonly-
processes indirectly identify each other using a port or mailbox Source sends a message to a port
and destination receives the message from the port UDP port is 16 bits, so there are 64K possible
ports- not enough for all Internet hosts Process is identified as a port on a particular host – a
(port, host) pair.
To send a message the process learns the port in the following way:
A client initiates a message exchange with a server process. The server knows the client’s port
(contained in message header and can reply to it. Server accepts messages at a well known port.
Examples: DNS at port 53, mail at port 25
38. List out the various features of sliding window protocol.
The key feature of the sliding window protocol is that it permits pipelined communication. In
contrast, with a simple stop-and-wait protocol, the sender waits for an acknowledgment after
transmitting every frame. As a result, there is at most a single outstanding frame on the channel
at any given time, which may be far less than the channel's capacity. For maximum throughput,
the amount of data in transit at any given time should be equal to (channel bandwidth) X
(channel delay).
39. What is the function of a router?
Connect network segment together
Router forwards the packet to the right path
41. What is the difference between congestion control and flow control? Nov 2015 ,Nov/Dec
2017
Congestion control
It involves preventing too much data from being injected into the network, thereby causing
switches or links to become overloaded. Thus flow control is an end to an end issue, while
congestion control is concerned with how hosts and networks interact.
Flow control
The amount of data flowed from source to destination should be restricted. The source can send
one byte at a time, but it will take long time to transmit n bytes
6
CS8591 - COMPUTER NETWORKS
46. List the approaches to QoS support or what are the approaches used to provide range
of Quality of services Nov/Dec 2017
48. List some of the Quality of service parameters of transport layer (May 2015)
Reliability
Delay
Jitter
Bandwidth
49. How does transport layer perform duplication control? (May 2015)
Duplication can be controlled by the use of sequence number & acknowledgment number
50. What do you mean by slow start in TCP congestion? (May 2016)
The sender starts with a very slow rate of transmission but increases the rate rapidly to
reach a threshold
52. List out the advantages of connection oriented services over connectionless services. (APR
2017)
Advantage of connection oriented:
(i) In connection oriented virtual circuit,buffers can be reversed in advance
(ii) Sequencing can be guaranteed
(iii)Short-headers can be used
(iv) Troubles caused by delayed duplicate packets can be avoided
Advantage of connectionless:
(i) It can be used over subnets that do not use virtual circuit inside
7
CS8591 - COMPUTER NETWORKS
16 MARKS
INTRODUCTION
The transport layer is located between the application layer and the network layer. It
provides a process-to-process communication between two application layers, one at the local
host and the other at the remote host. Communication is provided using a logical connection,
which means that the two application layers, which can be located in different parts of the globe,
assume that there is an imaginary direct connection through which they can send and receive
messages.
Transport-Layer Services
Each protocol provides a different type of service and should be used appropriately.
UDP
UDP is an unreliable connectionless transport-layer protocol used for its simplicity and
efficiency in applications where error control can be provided by the application-layer process.
TCP
TCP is a reliable connection-oriented protocol that can be used in any application where
reliability is important.
SCTP
SCTP is a new transport-layer protocol that combines the features of UDP and TCP.
Process-to-Process Communication
The first duty of a transport-layer protocol is to provide process-to-process communication. A
process is an application-layer entity (running program) that uses the services of the transport
layer. A transport-layer protocol is responsible for delivery of the message to the appropriate
process
8
CS8591 - COMPUTER NETWORKS
9
CS8591 - COMPUTER NETWORKS
ICANN Ranges
ICANN has divided the port numbers into three ranges: well-known, registered, and dynamic (or
private), as shown in Figure 23.5
❑ Well-known ports. The ports ranging from 0 to 1023 are assigned and controlled by ICANN.
These are the well-known ports.
❑ Registered ports. The ports ranging from 1024 to 49,151 are not assigned or controlled by
ICANN. They can only be registered with ICANN to prevent duplication.
❑Dynamic ports. The ports ranging from 49,152 to 65,535 are neither controlled nor registered.
They can be used as temporary or private port numbers.
Socket Addresses
A transport-layer protocol in the TCP suite needs both the IP address and the port number, at
each end, to make a connection. The combination of an IP address and a port number is called a
socket address. The client socket address defines the client process uniquely just as the server
socket address defines the server process uniquely
10
CS8591 - COMPUTER NETWORKS
Flow Control
Whenever an entity produces items and another entity consumes them, there should be a balance
between production and consumption rates
Error Control
Error control at the transport layer is responsible for
1. Detecting and discarding corrupted packets.
2. Keeping track of lost and discarded packets and resending them.
3. Recognizing duplicate packets and discarding them.
4. Buffering out-of-order packets until the missing packets arrive.
Congestion Control
Congestion control refers to the mechanisms and techniques that control the congestion and
keep the load below the capacity
Connection-Oriented Service
In a connection-oriented service, the client and the server first need to establish a logical
connection between themselves. The data exchange can only happen after the connection
establishment. After data exchange, the connection needs to be torn down
11
CS8591 - COMPUTER NETWORKS
Simple Protocol
Stop-and-Wait Protocol
Go-Back-N Protocol (GBN)
Selective-Repeat Protocol
Bidirectional Protocols: Piggybacking
Simple Protocol
Our first protocol is a simple connectionless protocol with neither flow nor error control. We
assume that the receiver can immediately handle any packet it receives. In other words, the
receiver can never be overwhelmed with incoming packets.
After transmitting one frame, the sender waits for an acknowledgment before transmitting
the next frame.
If the acknowledgment does not arrive after a certain period of time, the sender times out
and retransmit the original frame.
a) The ACK is received before the timer expires b) The original frame is lost
Fig: illustrates four different scenarios that result from this basic algorithm. The sending side is
represented on the left, the receiving side is depicted on the right, and time flows from top to
bottom.
In Fig (a) ACK is received before the timer expires, (b) and (c) show the situation in which
the original frame and the ACK, respectively, are lost, and (d) shows the situation in which the
timeout fires too soon..
Suppose the sender sends a frame and the receiver acknowledges it, but the acknowledgment
is either lost or delayed in arriving. This situation is in (c) and (d). In both cases, the sender times
out and retransmit the original frame, but the receiver will think that it is the next frame, since it
correctly received and acknowledged the first frame.
This makes the receiver to receive the duplicate copies. To avoid this two sequence numbers
(0 and 1) must be used alternatively.
13
CS8591 - COMPUTER NETWORKS
The main drawback of the stop-and-wait algorithm is that it allows the sender have only one
outstanding frame on the link at a time.
Go – Back N Protocol
Sender Window
At the beginning of transmission, the sender window contains n-1 frames. As frames are
sent out, the left boundary of the window moves inward, shrinking the size of the window
If size of window is W if three frames have been transmitted since the last
acknowledgement then the number of frames left in the window is w -3.
Once an ACK arrives, the window expands to allow in a number of new frames equal to
the number of frames acknowledged by that ACK.
14
CS8591 - COMPUTER NETWORKS
Receiver Window
The receive window is an abstract concept defining an imaginary box of size 1 with one
single variable Rn.
The window slides when a correct frame has arrived, sliding occurs one slot at a time.
When the timer expires, the sender resends all outstanding frames. For example, suppose the
sender has already sent frame 6, but the timer for frame 3 expires. This means that frame 3 has
not been acknowledged; the sender goes back and sends frames 3, 4,5, and 6 again. That is why
the protocol is called Go-Back-N.
Sender Window
15
CS8591 - COMPUTER NETWORKS
Receiver window
The Selective Repeat Protocol allows as many frames as the size of the receive window to
arrive out of order and be kept until there is a set of in-order frames to be delivered to the
network layer.
Because the sizes of the send window and receive window are the same, all the frames in the
send frame can arrive out of order and be stored until they can be delivered.
If any frame lost, sender has to retransmit only that lost frames.
16
CS8591 - COMPUTER NETWORKS
The UDP is called a connection less, unreliable transport protocol. The purpose of UDP
is to break up a stream of data into datagram, add a source and destination port information, a
length and a checksum. It is the receiving application's responsibility to detect and recover lost or
damaged packets, as UDP doesn't take care of this.
Advantages:
User Datagram:
UDP packets called user datagram which has a fixed size header of 8 bytes.
17
CS8591 - COMPUTER NETWORKS
Length
This is a 16 bits field that defines the total length of the user data gram, header plus data.
The 16 bits can defined a total length of 0 to 65535 bytes.
Checksum
This field is used to detect errors over the entire user datagram. The calculation of
checksum and its inclusion in the user datagram are optional.
18
CS8591 - COMPUTER NETWORKS
This mapping is published periodically in an RFC and is available on the most Unix
systems in file /etc/services. Sometimes a well-known port to agree on some other port that they
will use for subsequent communication leaving the well-known port free for other clients.
A port is purely an abstraction. Exactly how it is implemented differs from system to
system, or more precisely, from OS to OS.
For example, the socket API is an example implementation of ports. Typically, a port is
implemented by a message queue.
When a message arrives, the protocol l(eg.UDP) appends the message to the end of the
queue. Should the queue be full, the message is discarded.
There is no flow-control mechanism that tells the sender to slow down. When an
application process wants to receive a message, one is removed from the front of the queue. If
the queue is empty, the process blocks until a message becomes available.
4. Describe in detail about TCP segment (Header) format (NOV 2013, 2014)(May & Nov 2015) or
Draw the format of TCP Packet header and explain each of its field and Specify the
justification for having variable field length for the field in TCP header. Apr 2017
A Packet in TCP is called a segment. The below diagram shows the format of the segment.
The segment consists of a 20 to 60 byte header, followed by data from the application program.
The header is 20 bytes if there are no options and up to 60 bytes if it contains options.
Header
19
CS8591 - COMPUTER NETWORKS
– The header is composed of a 20-byte fixed part and an optional part with a variable
length. The total size of the header (in 32-bit words) is specified in HLEN.
Data - The data can have a variable size, which can be up to 65535 – 20 = 65515 bytes.
Source port number (16 bits)
– The SOURCE PORT field identifies the TCP process which sent the datagram.
Reserved
– This is a 6-bit field reserved for future use.
Code bits
– The CODE BITS (or FLAGS) field contains one or more 1-bit flags
– Control bits to indicate end of stream, acknowledgement field being valid, connection
reset, urgent pointer field being valid, etc.
20
CS8591 - COMPUTER NETWORKS
[CONTROL]: URG (1)- Urgent Bit validates the Urgent Pointer field.
Acknowledge Bit, set if the Acknowledge Number field is being
[CONTROL]: ACK (1)-
used.
[CONTROL]: PSH (1)- Push Bit tells the sender that a higher throughput is required.
Reset Bit resets the connection when there's conflicting sequence
[CONTROL]: RST (1)-
numbers.
Sequence Number Synchronization. Used in 3 types of segments:
connection request, connection confirmations (with ACK) and
[CONTROL]: SYN (1)- confirmation termination (with FIN) in 3 types of segments:
terminal request, terminal confirmation (with ACK) and
acknowledgement of terminal confirmation (with ACK).
[CONTROL]: FIN (1)- Used with SYN to confirm termination of connections
Note: The process of sending data along with the acknowledgment is called piggybacking
Checksum(16 bit)
– The CHECKSUM field contains a simple checksum over the TCP segment header and
data.
Urgent Pointer (16 bit)
– This 16-bit field, which is valid only if the urgent flag is set, is used when the segment
contains urgent data. It defines the number that must be added to the sequence number to
obtain the number of the last urgent byte in the data section of the segment.
Options
– There can be up to 40 bytes of optional information in the TCP header.
5. Explain in detail about TCP connection establishment & termination (TCP Connection
Management) (NOV 2013) (May & Nov 2015) Nov 2017
Connection establishment:
TCP transmits data in full-duplex mode. When two TCP’s in two machines or connected, they
are able to send segments to each other simultaneously.
21
CS8591 - COMPUTER NETWORKS
Three-way handshaking.
The connection establishment in TCP is called three way handshaking. The process starts with
the server. The server program tells its TCP that it is ready to accept a connection. This is called
a request for a passive open.
The client program issues a request for an active open. A client that wishes to connect to an
open server tells its TCP that it needs to be connected to that particular server. TCP can now
start the three-way handshaking process. Each segment has the sequence number the
acknowledgement number, the control flags, and the window size, if not empty.
1. The client sends the first segment, a SYN segment, in which only the SYN flag is set.
This segment is for synchronization of sequence numbers. It consumes one sequence
number. When the data transfer starts, the sequence number is incremented by 1. A
SYN segment cannot carry data, but it consumes one sequence number.
2. The server sends the second segment, a SYN + ACK segment, with 2 flag bits set: SYN
and ACK. This segment has a dual pupose. It is a SYN segment for communication in
the other direction and serves as the acknowledgement for the SYN segment. It
consumes one sequence number.
3. The client sends the third segment. This is just an ACK segment. It acknowdeges the
receipt of the second segmant with the ACK flag and acknowledgment number field.
Data Transfer
After connection is established, bidirectional data transfer can take place. The client and server
can both send data and acknowledgements.
The below figure shows an example. In this example, after connection is established, the client
sends 2000 bytes of data in two segments. The server then sends 2000 bytes in one segment.
The client sends one more segment. The first three segments carry both data and
acknowledgment, but the last segment carries only an acknowledgement because there are no
more data to be sent.
The data segments sent by the client have the PSH (push) flag set so that the server TCP knows
to deliver data to the server process as soon as they are received.
22
CS8591 - COMPUTER NETWORKS
Pushing Data: The sending TCP uses a buffer to store the stream of data coming from
the sending application program. The sending TCP can select the segment size. The
receiving TCP also buffers the data when they arrive and delivers them to the application
program when the application program is ready or when it is convenient for the receiving
TCP. This type of flexibility increases the efficiency of TCP.
The application program at the sending site can request a push operation. This means
that the sending TCP must not wait for the window to be filled. It must create a segment
and send it immediately. The sending TCP must also set the push bit (PSH) to let the
receiving TCP know that the segment includes data that must be delivered to the
receiving application program as soon as possible and not to wait for more data to come.
Any of the two parties involved in exchanging data (client or server) can close the connection,
although it is usually initiated by the client. Most implementations today allow two options for
connection termination: three-way handshaking and four-way handshaking with a half-close
option.
Three-way handshaking
In a normal situation, the client TCP, after receiving a close command from the client process,
sends the first segment, a FIN segment in which the FIN flag is set. The FIN segment consumes
one sequence number if it does not carry data.
1. The server TCP, after receiving the FIN segment, informs its process of the situation and
sends the second segment, a FIN + ACK segment, to confirm the receipt of the FIN
segment from the client and at the same time to announce the closing of the connection in
the other direction. This segment can also contain the last chunk of data from the server.
The FIN + ACK segment consumes one sequence number if it does not carry data.
23
CS8591 - COMPUTER NETWORKS
2. The client TCP sends the last segment, an ACK segment, to confirm the receipt of the
FIN segment from the TCP server. This segment contains the acknowledgement number,
which is 1 plus the sequence number received in the FIN segment from the server. This
segment cannot carry data and consumes no sequence number.
24
CS8591 - COMPUTER NETWORKS
Client Diagram:
Server Diagram:
25
CS8591 - COMPUTER NETWORKS
TCP Services
Process-to-Process Communication
As with UDP, TCP provides process-to-process communication using port numbers
Full-Duplex Communication
TCP offers full-duplex service, where data can flow in both directions at the same time.
Each TCP endpoint then has its own sending and receiving buffer, and segments move in both
directions
26
CS8591 - COMPUTER NETWORKS
Connection-Oriented Service
TCP, unlike UDP, is a connection-oriented protocol. When a process at site A wants to send to
and receive data from another process at site B, the following three phases occur:
1. The two TCP’s establish a logical connection between them.
2. Data are exchanged in both directions.
3. The connection is terminated.
Reliable Service
TCP is a reliable transport protocol. It uses an acknowledgment mechanism to check the safe and
sound arrival of data. We will discuss this feature further in the section on error control.
TCP Features
Numbering System
Byte Number
Sequence Number
Acknowledgment Number
Windows in TCP:
Send Window
The sender maintains three variables:
The send window size, denoted SWS, gives the upper bound on the number of outstanding
(unacknowledged) frames that the sender can transmit;
LAR denotes the sequence number of the last acknowledgment received; and
LFS denotes the sequence number of the last frame sent.
LFS−LAR ≤ SWS
When an acknowledgment arrives, the sender moves LAR to the right, thereby allowing the
sender to transmit another frame. Also, the sender associates a timer with each frame it transmits,
and it retransmits the frame should the timer expire before an ACK is received. Notice that the
sender has to be willing to buffer up to SWS frames since it must be prepared to retransmit them
until they are acknowledged.
Receive Window
LAF−LFR ≤ RWS
27
CS8591 - COMPUTER NETWORKS
When a frame with sequence number SeqNum arrives, the receiver takes the following action. If
SeqNum ≤ LFR or SeqNum > LAF, then the frame is outside the receiver’s window and it is
discarded. If LFR < SeqNum ≤ LAF, then the frame is within the receiver’s window and it is
accepted.
Now the receiver needs to decide whether or not to send an ACK. Let SeqNumToAck denote the
largest sequence number not yet acknowledged, such that all frames with sequence numbers less
than or equal to SeqNumToAck have been received.
The receiver acknowledges the receipt of SeqNumToAck, even if higher numbered packets have
been received. This acknowledgment is said to be cumulative. It then sets LFR = SeqNumToAck
and adjusts LAF = LFR+RWS.
7. Explain in detail about TCP flow control OR TCP Adaptive flow control (NOV/DEC 2013,
2014) APR 2017
TCP uses a sliding window mechanism to control the flow of data. When a connection is
established, each end of the connection allocates a buffer to hold incoming data, and sends the
size of the buffer to the other end. As data arrives, the receiver sends acknowledgements together
with the amount of buffer space available called a window advertisement.
To make the following discussion simpler to follow, we initially ignore the fact that both
the buffers and the sequence numbers are of some finite size and hence will eventually wrap
28
CS8591 - COMPUTER NETWORKS
around. Also, we do not distinguish between a pointer into a buffer where a particular byte of
data is stored and the sequence number for that byte
Looking first at the sending side, three pointers are maintained into the send buffer, each
with an obvious meaning: LastByteAcked, LastByteSent, and LastByteWritten. Clearly
LastByteAcked ≤ LastByteSent
since the receiver cannot have acknowledged a byte that has not yet been sent, and
LastByteSent ≤ LastByteWritten
since TCP cannot send a byte that the application process has not yet written. Also note that none
of the bytes to the left of LastByteAcked need to be saved in the buffer because they have
already been acknowledged, and none of the bytes to the right of LastByteWritten need to be
buffered because they have not yet been generated.
A similar set of pointers (sequence numbers) are maintained on the receiving side:
LastByteRead, NextByteExpected, and LastByteRcvd. The inequalities are a little less intuitive,
however, because of the problem of out-of-order delivery. The first relationship
is true because a byte cannot be read by the application until it is received and all preceding
bytes have also been received. NextByteExpected points to the byte immediately after the latest
byte to meet this criterion. Second,
NextByteExpected ≤ LastByteRcvd+1
since, if data has arrived in order, NextByteExpected points to the byte after LastByteRcvd,
whereas if data has arrived out of order, then NextByteExpected points to the start of the first gap
in the data, as in Figure 5.8.Note that bytes to the left of LastByteRead need not be buffered
because they have already been read by the local application process, and bytes to the right of
LastByteRcvd need not be buffered because they have not yet arrived.
Flow Control
29
CS8591 - COMPUTER NETWORKS
Recall that in a sliding window protocol, the size of the window sets the amount of data that can
be sent without waiting for acknowledgment from the receiver. Thus, the receiver throttles the
sender by advertising a window that is no larger than the amount of data that it can buffer.
Observe that TCP on the receive side must keep
LastByteRcvd−LastByteRead ≤ MaxRcvBuffer
which represents the amount of free space remaining in its buffer. As data arrives, the receiver
acknowledges it as long as all the preceding bytes have also arrived. In addition, LastByteRcvd
moves to the right (is incremented), meaning that the advertised window potentially shrinks.
Whether or not it shrinks depends on how fast the local application process is consuming data. If
the local process is reading data just as fast as it arrives (causing LastByteRead to be
incremented at the same rate as LastByteRcvd), then the advertised window stays open (i.e.,
AdvertisedWindow = MaxRcvBuffer). If, however, the receiving process falls behind, perhaps
because it performs a very expensive operation on each byte of data that it reads, then the
advertised window grows smaller with every segment that arrives, until it eventually goes to 0.
TCP on the send side must then adhere to the advertised windowit gets from the receiver.
This means that at any given time, it must ensure that
LastByteSent−LastByteAcked ≤ AdvertisedWindow
Said another way, the sender computes an effective window that limits how much data it can
send:
EffectiveWindow = AdvertisedWindow−(LastByteSent−LastByteAcked)
All the while this is going on, the send side must also make sure that the local application
process does not overflow the send buffer—that is, that
LastByteWritten−LastByteAcked ≤ MaxSendBuffer
then TCP blocks the sending process and does not allow it to generate more data.
TCP copies with the loss of packets using a technique called retransmission. When TCP
data arrives an acknowledgement is sent back to the sender. Whenever a TCP segment is
transmitted, a copy of it is also placed on the retransmission queue. When TCP data is sent, a
timer is started this starts from a particular value and counts down to zero. If the timer expires
before an acknowledgement arrives, TCP retransmits the data.
30
CS8591 - COMPUTER NETWORKS
Original Algorithm
We begin with a simple algorithm for computing a timeout value between a pair of hosts.
This is the algorithm that was originally described in the TCP specification—and the following
description presents it in those terms—but it could be used by any end-to-end protocol.
The idea is to keep a running average of the RTT and then to compute the timeout as a
function of this RTT. Specifically, every time TCP sends a data segment, it records the time.
When an ACK for that segment arrives, TCP reads the time again, and then takes the difference
between these two times as a SampleRTT. TCP then computes an EstimatedRTT as a weighted
average between the previous estimate and this new sample. That is,
The parameter _ is selected to smooth the EstimatedRTT. A small _ tracks changes in the
RTT but is perhaps too heavily influenced by temporary fluctuations. On the other hand, a large
is more stable but perhaps not quick enough to adapt to real changes. The original TCP
specification recommended a setting of between 0.8 and 0.9. TCP then uses EstimatedRTT to
compute the timeout in a rather conservative way:
TimeOut = 2×EstimatedRTT
Karn/Partridge Algorithm
After several years of use on the Internet, a rather obvious flaw was discovered in this
simple algorithm. The problem was that an ACK does not really acknowledge a transmission; it
actually acknowledges the receipt of data. In other words, whenever a segment is retransmitted
and then an ACK arrives at the sender, it is impossible to determine if this ACK should be
associated with the first or the second transmission of the segment for the purpose of measuring
the sample RTT.
It is necessary to know which transmission to associate it with so as to compute an
accurate SampleRTT. As illustrated in Figure 5.10, if you assume that the ACK is for the
original transmission but it was really for the second, then the SampleRTT is too large (a); if you
assume that the ACK is for the second transmission but it was actually for the first, then the
SampleRTT is too small (b).
The solution, which was proposed in 1987, is surprisingly simple. Whenever TCP retransmits a
segment, it stops taking samples of the RTT; it only measures SampleRTT for segments that
have been sent only once. This solution is knownas the Karn/Partridge algorithm, after its
inventors.
31
CS8591 - COMPUTER NETWORKS
Their proposed fix also includes a second small change to TCP’s timeout mechanism.
Each time TCP retransmits, it sets the next timeout to be twice the last timeout, rather than
basing it on the last EstimatedRTT. That is, Karn and Partridge proposed that TCP use
exponential backoff, similar to what the Ethernet does. The motivation for using exponential
backoff is simple: Congestion is the most likely cause of lost segments, meaning that the TCP
source should not react too aggressively to a timeout. In fact, the more times the connection
times out, the more cautious the source should become
Jacobson/Karels Algorithm
The Karn/Partridge algorithm was introduced at a time when the Internet was suffering
from high levels of network congestion. Their approach was designed to fix some of the causes
of that congestion, but, although it was an improvement, the congestion was not eliminated. The
following year (1988), two other researchers—Jacobson and Karels—proposed a more drastic
change to TCP to battle congestion. The bulk of that proposed change is described in Chapter 6.
Here, we focus on the aspect of that proposal that is related to deciding when to time out and
retransmit a segment.
The main problem with the original computation is that it does not take the variance of
the sample RTTs into account. Intuitively, if the variation among samples is small, then the
EstimatedRTT can be better trusted and there is no reason for multiplying this estimate by 2 to
compute the timeout. On the other hand, a large variance in the samples suggests that the timeout
value should not be too tightly coupled to the EstimatedRTT.
In the new approach, the sender measures a new SampleRTT as before. It then folds this new
sample into the timeout calculation as follows:
32
CS8591 - COMPUTER NETWORKS
where is a fraction between 0 and 1. That is, we calculate both the mean RTT and the variation
in that mean.
TCP then computes the timeout value as a function of both Estimated- RTT and
Deviation as follows:
where based on experience, is typically set to 1 and is set to 4. Thus, when the variance is
small, TimeOut is close to EstimatedRTT; a large variance causes the Deviation termto dominate
the calculation.
9. Explain in detail about TCP congestion control mechanisms OR Brief about approaches used
for TCP congestion control (NOV 2013, 2014, 2015, 2016,2017) OR With TCPs slow start
and AIMD for congestion control,show how the window size will vary for a transmission
where every 5TH Packet is lost.Assume an advertised window size of 50 MSS (APR 2017)
Congestion, in a network may occur if the load on the network – the number of packets sent to
the network is greater than the capacity of the network – the number of packets a network can
handle.
Congestion control refers to the mechanisms and techniques to control the congestion and
keep the load below the capacity that can either prevent congestion before it happens or
remove congestion, after it has happened.
There are two categories of congestion control
– Open-loop congestion control (prevention): are applied to prevent congestion
before it happens. In this, congestion control is handled by either the source or
the destination.
– Closed-loop congestion control (removal): try to remove congestion after it
happens.
Too many sources sending too much data too fast for network to handle. TCP uses congestion
control to avoid congestion or remove congestion in the network.
Factors of congestion:
Congestion Window
33
CS8591 - COMPUTER NETWORKS
The sender’s window size is determined by the receiver and also by congestion in the network.
The sender has two pieces of information:
i) The receiver – advertised window size (rwnd)
ii) The congestion window size (cwnd)
Congestion Policy:
TCP handles congestion is based on three phases
i) Slow start (Exponential Increase )
ii) Additive Increase / Multiplicative Decrease
iii) Fast Retransmit and Fast Recovery
i) Slow Start
In this, the sender starts with a very slow rate of transmission but increases the rate rapidly to
reach a threshold.
Slow start adds another window to the sender's TCP: the congestion window, called "cwnd".
When a new connection is established with a host on another network, the congestion window is
initialized to one segment. Each time an ACK is received, the congestion window is increased
by one segment. The sender can transmit up to the minimum of the congestion window and the
advertised window. The congestion window is flow control imposed by the sender, while the
advertised window is flow control imposed by the receiver. The former is based on the sender's
assessment of perceived network congestion; the latter is related to the amount of available
buffer space at the receiver for this connection.
The sender starts by transmitting one segment and waiting for its ACK. When that ACK is
received, the congestion window is incremented from one to two, and two segments can be sent.
When each of those two segments is acknowledged, the congestion window is increased to four.
This provides an exponential growth, although it is not exactly exponential because the receiver
may delay its ACKs, typically sending one ACK for every two segments that it receives.
At some point the capacity of the internet can be reached, and an intermediate router will start
discarding packets. This tells the sender that its congestion window has gotten too large.
34
CS8591 - COMPUTER NETWORKS
Early implementations performed slow start only if the other end was on a different network.
Current implementations always perform slow start.
When the size of window in bytes reaches this threshold, slow start stops and the next phase
starts.
35
CS8591 - COMPUTER NETWORKS
To avoid congestion before it happens, one must slow down the exponential growth. When the
size of the congestion window reaches the slow start threshold, the slow start phase steps and the
additive phase begins. In this, each time the whole window of segments is acknowledged, the
size of the congestion window is increased by 1.
After the sender has received acknowledgements for a complete window size of segments, the
size of the congestion window increases additively until congestion is detected.
The congestion window is incremented as follows each time an ACK arrives:
Multiplicative Decrease
If congestion occurs, the congestion window size must be decreased. Retransmission can occur
in one of two cases, when a timer times out (or) when three ACKS are received. In both cases,
the size of the threshold is dropped to one-half, a multiplicative decrease.
36
CS8591 - COMPUTER NETWORKS
a. It sets the value of the threshold to one-half of the current window size.
b. It sets cwnd to the value of the threshold.
c. It starts the congestion avoidance phase
Every time a data packet arrives at the receiving side, the receiver responds with an
acknowledgement. When a packet arrives out of order, TCP resends the same acknowledgement
is sent the last time. This second transmission of the same acknowledgement is called a
duplicate ACK.
When the sending side sees a duplicate ACK, it knows that the other side must have received a
packet out of order. The sender waits until it sees some no. of duplicate ACK’s and then
retransmit the missing packet. TCP waits until it has seen three duplicate ACK’s before
retransmitting the packet.
In this diagram, the destination receives packets 1 & 2, but packet 3 is lost in the network. Thus
the destination will send a duplicate ACK for packet 2 when packet 4 arrives, again when packet
5 arrives & so on. When the sender sees the third duplicate ACK for packet 2, the receiver had
gotten packet 6, it retransmits packet s. When the retransmitted copy of packet 3 arrives at the
destination, the receiver then sends a cumulative ACK for everything up to and including packet
6 back to the sends.
37
CS8591 - COMPUTER NETWORKS
Fast Recovery
After fast retransmit sends what appears to be the missing segment, congestion avoidance, but
not slow start is performed. This is the fast recovery algorithm. It is an improvement that allows
high throughput under moderate congestion, especially for large windows.
The reason for not performing slow start in this case is that the receipt of the duplicate ACKs
tells TCP more than just a packet has been lost. Since the receiver can only generate the
duplicate ACK when another segment is received, that segment has left the network and is in the
receiver's buffer. That is, there is still data flowing between the two ends, and TCP does not want
to reduce the flow abruptly by going into slow start.
The fast retransmit and fast recovery algorithms are usually implemented together as follows.
1. When the third duplicate ACK in a row is received, set ssthresh to one-half the current
congestion window, cwnd, but no less than two segments. Retransmit the missing
segment. Set cwnd to ssthresh plus 3 times the segment size. This inflates the congestion
window by the number of segments that have left the network and which the other end
has cached.
2. Each time another duplicate ACK arrives, increment cwnd by the segment size. This
inflates the congestion window for the additional segment that has left the network.
Transmit a packet, if allowed by the new value of cwnd.
3. When the next ACK arrives that acknowledges new data, set cwnd to ssthresh (the value
set in step 1). This ACK should be the acknowledgment of the retransmission from step
1, one round-trip time after the retransmission. Additionally, this ACK should
acknowledge all the intermediate segments sent between the lost packet and the receipt of
38
CS8591 - COMPUTER NETWORKS
the first duplicate ACK. This step is congestion avoidance, since TCP is down to one-half
the rate it was at when the packet was lost.
When fast retransmit detects three duplicate ACKs, start the recovery process from
congestion avoidance region and use ACKs in the pipe to pace the sending of packets.
10. Write a detailed note on congestion avoidance mechanism used in TCP. NOV 2017
Or Explain congestion avoidance using random early detection in transport layer with example
APR 2017
DECbit
It is a first mechanism
The idea here is to more evenly split the responsibility for congestion control between the
routers and the end nodes.
Each router monitors the load it is experiencing and explicitly notifies the end nodes
when congestion is about to occur.
This notification is implemented by setting a binary congestion bit in the packets that
flow through the router: hence the name DECbit.
The destination host then copies this congestion bit into the ACk it sends back to the
source.
How it is functioning:
A single congestion bit is added to the packet header. A router sets this bit in a packet if
its average queue length is grater than or equal to 1 at the time the packet arrives.
This average queue length is measured over a time interval that distance the last bust +
idle cycle, plus the current busy cycle. (The router is busy when it is transmitting and
idles when it is not).
The above figure shows the queue length at a router as a function of time. Essentially,
the router calculates the area under the curve and divides this value by the time interval to
compute the average queue length
If less than 50% of the packets had the bit set, then the source increases its congestion window
by one packet. If 50% or more of the last window’s worth of packets had the congestion bit set,
the source decreases its congestion window to 0.875 times the previous value.
39
CS8591 - COMPUTER NETWORKS
A second mechanism, called random early detection (RED), is similar to the DECbit scheme in
that each router is programmed to monitor its own queue length, and when it detects that
congestion is imminent (forthcoming), to notify the source to adjust its congestion window.
The first is that rather than explicitly sending a congestion notification message to the
source, RED is most commonly implemented such that it implicitly notifies the source of
congestion by dropping one of its packets.
The source is, effectively notified by the subsequent timeout or duplicates ACK. In case
you haven’t already guessed, RED is designed to be used in conjunction with TCP, which
currently detects congestion by means of timeouts.
As the “early” part of the RED acronym suggests, the gateway drops the packet earlier
than it would have to, so as to notify the source that it should decrease its congestion
window sooner than it would normally have.
In other words, the router drops a few packets before it has exhausted its buffer space
completely, so as to cause the source to slow down, with the hope that this will mean it
does not have to drop lots of packets later on.
Note that RED could easily be adapted to work with an explicit feedback scheme simply
by marking a packet instead of dropping it, as discussed in the sidebar on Explicit
Congestion Notification.
A strategy for detecting the initial stages of congestion – before losses occur – from the
end hosts.
40
CS8591 - COMPUTER NETWORKS
The general idea of these techniques is to watch for some sign from the network that
some router’s queue is building up and that congestion will happen soon if nothing is
done about it.
A first Scheme the congestion window normally increases as in TCP, but every two
round-trip delays the algorithm checks to see if the current RTT is greater than the
average of the minimum and maximum RTT’s seen so far. If it is, then the algorithm
decreases the congestion window by one-eighth.
A second algorithm is the decision as to whether or not to change the current window
size is based on changes to both the RTT and the window size. The window is adjusted
once every two round-trip delays based on the product
If the result is positive, the source decreases the window size by one-eighth; if the result
is negative or 0, the source increases the window by one maximum packet size.
A third scheme, Every RTT, it increases the window size by one packet and compares
the throughput achieved to the throughput when the window was one packet smaller. If
the difference is less than one-half the throughput achieved when only one packet was in
transit. If the difference is greater than the algorithm decreases the window by one
packet. This scheme calculates the throughput by dividing the number of bytes
outstanding in the network by the RTT.
It compares the measured throughput rate with an expected throughput rate. The
algorithm, which is called TCP Vegas.
TCP Vegas uses this idea to measure and control the amount of extra data this connection
has in transit, where by “extra data” we mean that the source would not have transmitted
had it been trying to match exactly the available bandwidth of the network. The goal of
TCP Vegas is to maintain the “right” amount of extra data in the network.
Obviously, if a source is sending too much extra data, it will cause long delays and
possibly lead to congestion. Less obviously, if a connection is sending too little extra
data, it cannot respond rapidly enough to transient increases in the available network
bandwidth.
TCP Vegas sets BaseRTT to the minimum of all measured round-trip times; it is
commonly the RTT of the first packet sent by the connection, before the router
queues increase due to traffic generated by this flow. If we assume that we are
not overflowing the connection, then the expected throughput is give by
41
CS8591 - COMPUTER NETWORKS
bytes are transmitted between the time that packet is sent and when its
acknowledgment is received, computing the sample RTT for the distinguished
packet when its acknowledgment arrives, and dividing the number of bytes
transmitted by the sample RTT. This calculation is done once per round-trip time.
Third, TCP Vegas compares ActualRate to ExpectedRate and adjusts the window
accordingly. We let Diff = ExpectedRate – ActualRate. Note that Diff is positive
or 0 by definition, since ActualRate > ExpectedRate implies that we need to
change BaseRTT to the latest sampled RTT.
We also define two thresholds, α < β, roughly corresponding to having too little and too
much extra data in the network, respectively. When Diff < α, TCP Vegas increases the
congestion window linearly during the next RTT, and when Diff > β, TCP Vegas
decreases the congestion window linearly during the next RTT. TCP Vegas leaves the
congestion window unchanged when α < Diff < β.
SCTP Services
Process-to-Process Communication
Multiple Streams
SCTP allows multistream service in each connection, which is called association in SCTP
terminology. If one of the streams is blocked, the other streams can still deliver their data.
Multihoming
The sending and receiving host can define multiple IP addresses in each end for an association.
In this fault-tolerant approach, when one path fails, another interface can be used for data
delivery without interruption. This fault-tolerant feature is very helpful when we are sending and
receiving a real-time payload such as Internet telephony.
42
CS8591 - COMPUTER NETWORKS
Full-Duplex Communication
Connection-Oriented Service
Reliable Service
SCTP Features
Acknowledgment Number
TCP acknowledgment numbers are byte-oriented and refer to the sequence numbers. SCTP
acknowledgment numbers are chunk-oriented. They refer to the TSN. A second difference
between TCP and SCTP acknowledgments is the control information
General Header
43
CS8591 - COMPUTER NETWORKS
The general header (packet header) defines the end points of each association to which
the packet belongs, guarantees that the packet belongs to a particular association, and preserves
the integrity of the contents of the packet including the header itself. The format of the general
header is shown in Figure 24.43.
There are four fields in the general header. The source and destination port numbers are
the same as in UDP or TCP. The verification tag is a 32-bit field that matches a packet to an
association. This prevents a packet from a previous association from being mistaken as a packet
in this association. It serves as an identifier for the association; it is repeated in every packet
during the association. The next field is a checksum. However, the size of the checksum is
increased from 16 bits (in UDP, TCP, and IP) to 32 bits in SCTP to allow the use of the CRC-32
checksum.
Chunks
Control information or user data are carried in chunks. Chunks have a common layout, The first
three fields are common to all chunks; the information field depends on the type of chunk
44
CS8591 - COMPUTER NETWORKS
Types of Chunks
SCTP defines several types of chunks
An SCTP Association
SCTP, like TCP, is a connection-oriented protocol. However, a connection in SCTP is called an
association to emphasize multihoming
Association Establishment
Data Transfer
o Multihoming Data Transfer
o Multistream Delivery
o Fragmentation
Association Termination
45
CS8591 - COMPUTER NETWORKS
46
CS8591 - COMPUTER NETWORKS
UNIVERSITY QUESTIONS
2 MARKS
1. Differentiate TCP and UDP. (Q.NO. 2)
2. What is QOS? (Q.NO.32)
16 MARKS
1. Explain the following
(i) TCP header (8) (Q.NO. 2)
(ii) Adaptive flow control (8) (Q.NO. 4)
2. How is congestion controlled? Explain in detail the TCP congestion control (16)(Q.NO. 6)
1. List some of the Quality of service parameters of transport layer (Q.NO. 48)
2. How does transport layer perform duplication control? (Q.NO. 49)
16 MARKS
1. Explain the various fields of TCP header and the working of TCP protocol (16) (Q.NO. 2 & 3)
2 (i) i.Explain the three way handshake protocol to establish the transport level connection (8)
(Q.NO. 3)
(ii) List the various congestion control mechanisms. Explain any one in detail (8) (Q.NO. 6)
2 MARKS
1. What is the difference between congestion control and flow control? (Q.NO 41)
2. What do you mean by QoS? (Q.NO 32)
16 MARKS
1. With a neat architecture, explain TCP in detail (Q.NO 2 & 3)
2. Explain TCP congestion control methods (Q.NO 6)
16 MARKS
1. Define UDP. Discuss the operations of UDP. Explain UDP checksum withone example. (Q.NO 1)
2. Explain in detail the various TCP congestion control mechanisms (Q.NO 6)
2 MARKS
1. Differentiate between TCP and UDP. (Q.NO 2)
47
CS8591 - COMPUTER NETWORKS
16 MARKS
1. Explain various fields of TCP header and the working of the TCP protocol (Q.NO 2)
2. How is Congestion controlled? Explain in detail about congestion control techniques in
transport layer (Q.NO 6)
16 MARKS
1. (i) Explain the adaptive flow control and retransmission technique used in TCP (Q.NO 4,5)
(ii) With TCPs slow start and AIMD for congestion control, show how the window size will
vary for a transmission where every 5th Packet is lost. Assume an advertised window size
of 50 MSS. (Q.NO 6)
2. (i) Explain congestion avoidance using random early detection in transport layer with example (Q.NO.7)
(ii) Explain the different services operation of QOS in detail. (Q.NO 9)
Part-C
1. (i)Draw the format of TCP Packet header and explain each of its field. (Q.NO 2)
(ii)Specify the justification for having variable field length for the field in TCP header.
2 MARKS
1. Compare flow control versus congestion control? (Q.NO 41)
2. What are the approaches used to provide range of quality of services? (Q.NO 46)
16 MARKS
1. (i)Draw the TCP state transition diagram for connection management. (Q.NO 3)
(ii)Brief about approaches used for TCP congestion control. (Q.NO 6)
2. Write a detailed note on congestion avoidance mechanism used in TCP. (Q.NO 7)
48
CS8591 - COMPUTER NETWORKS
PART A
2. What is Ethernet?
Ethernet is a multiple-access network, meaning that a set of nodes send and receive
frames over a shared link.
3. Define Repeater?
A repeater is a device that forwards digital signals, much like an amplifier forwards
analog signals. However, no more than four repeaters may be positioned between any pairs of
hosts, meaning that an Ethernet has a total reach of only 2,500m.
1
CS8591 - COMPUTER NETWORKS
It is used to forward the packets between shared media LANs such as Ethernet. Such
switches are sometimes known by the obvious name of LAN switches.
12. What are the three pieces of information in the configuration messages?
1. The ID for the bridge that is sending the message.
2. The ID for what the sending bridge believes to the root bridge.
3. The distance, measured in hops, from the sending bridge to the root bridge.
15. How does a given bridge learn whether it should forward a multicast frame over a
given port?
It learns exactly the same way that a bridge learns whether it should forward a unicast
frame over a particular port- by observing the source addresses that it receives over that port.
Fast Ethernet cards connect to networks at a rate of 100 Mbps while Gigabit network
cards can connect at speeds up to 1000mb/s. The main difference between the two is speed. A
fast Ethernet card can run on bandwidths at 100mb/s while a gigabit Ethernet can run at ten times
that speed. However, the existence of FDDIs around made this technology more like a stepping
stone to something better – enter the gigabit card. Gigabit networks are made to run the best at
Layer 3 switching meaning it has more route functionality than the 100mbs fast Ethernet.
18. What is the difference between switch and bridge? (NOV/DEC 2012)
Bridge Switch
A bridge is device which operates at the A bridge with more than two interface
data link layer. It may be used to join two (ports)is also known as a switch
2
CS8591 - COMPUTER NETWORKS
Bridges learns the association between the The switch reduces the number the
system MAC addresses and the interface number of packets on the other LAN
ports. segments, by sending the packet only
where it need to go.
.
19. Define bridge and switch. (NOV/DEC 2012)
Bridges are software based ,while switches are hardware based
Bridges can only have one spanning –tree instance per bridge, while switches can
have many
Bridges can only have up to 16 ports, whereas a switch can have hundreds.
20. State the difference between token ring and FDDI? (NOV/DEC 2010)
Token ring FDDI
22. A network with bandwidth of 10 Mbps can pass only an average of 12,000 frames per
minute with each frame carrying an average of 10,000 bits. What is the throughput of this
network? (APRIL/MAY 2011)
Throughput= (12,000*10,000)/60=2Mbps.
It is 1/5th of bandwidth.
23. What is the role of VCI?
A virtual channel identifier (VCI) distinguishes virtual channels (also known as circuits)
created in a packet/cell switched network. A VCI has multiple circuits per communication
channel and is primarily used for managing the unique identification of each created circuit.
3
CS8591 - COMPUTER NETWORKS
27. Define ICMP? (Or) Expand ICMP and write the function (May 2016)
Internet Control Message Protocol is a collection of error messages that are sent back to
the source host whenever a router or host is unable to process an IP datagram successfully
4
CS8591 - COMPUTER NETWORKS
33. Give the CIDR notation for class A, B and C. APR/MAY 2011)
36. What is the need for ARP? (NOV/DEC 2013) (Nov 2015)
5
CS8591 - COMPUTER NETWORKS
The technique for selecting an AP is called scanning and involves the following four
steps:
1. The node sends a Probe frame.
2. All APs within reach reply with a Probe Response frame.
3. The node selects one of the access points, and sends that AP an Association
Request frame.
4. The AP replies with an Association Response frame.
In non-persistent CSMA if the medium is busy, there will be a random delay for retransmission.
This reduces the probability of collisions, but wastes the capacity.
6
CS8591 - COMPUTER NETWORKS
The bluetooth network consisting of one or more piconets is known as scatternet. The
devices in one piconet type may function as master or slave in another piconet type of the same
csatternet
47. Identify the class of the following IP address: (a) 110.34.56.45 (b) 212.208.63.23 (Nov 2015)
110.34.56.45 - Class A
212.208.63.23 - Class C
52. Define bit stuffing. Give example (MAY 2011) (May 2017)
Bit stuffing is the insertion of one or more bits into a transmission unit as a way to provide
signaling information to a receiver. The receiver knows how to detect and remove or disregard
the stuffed bits.
e.g, Sending side - 011111010
7
CS8591 - COMPUTER NETWORKS
PART B
Services
The data-link layer is located between the physical and the network layers. The datalink
layer provides services to the network layer; it receives services from the physical layer. Let us
discuss services provided by the data-link layer.
The duty scope of the data-link layer is node-to-node. When a packet is travelling in the
Internet, the data-link layer of a node (host or router) is responsible for delivering a datagram to
the next node in the path. For this purpose, the data-link layer of the sending node needs to
encapsulate the datagram received from the network in a frame, and the data-link layer of the
receiving node needs to decapsulate the datagram from the frame.
Framing
Definitely, the first service provided by the data-link layer is framing. The data-link layer at
each node needs to encapsulate the datagram (packet received from the network layer) in a
frame before sending it to the next node. The node also needs to decapsulate the datagram from
the frame received on the logical channel.
Flow Control
Flow control refers to a set of procedures used to restrict the amount of data. The sender can send
before waiting for acknowledgment.
Error Control
8
CS8591 - COMPUTER NETWORKS
Error control is used for detecting and retransmitting damaged or lost frames and to prevent
duplication of frames. This is achieved through a trailer added at the end of the frame.
Congestion Control
It involves preventing too much data from being injected into the network, thereby causing
switches or links to become overloaded. Thus flow control is an end to an end issue, while congestion
control is concerned with how hosts and networks interact
Two Sublayers
To better understand the functionality of and the services provided by the link layer, we can
divide the data-link layer into two sublayers: data link control (DLC) and media access control
(MAC).
Each host or each interface of a router is assigned a unicast address. Unicasting means one-to-
one communication. A frame with a unicast address destination is destined only for one entity in
the link.
Multicast Address
9
CS8591 - COMPUTER NETWORKS
IP address
An IP address is an internetwork address. It is a universally unique address.
Every protocol involved in internetworking requires IP addresses.
MAC address
The packets from source to destination hosts pass through physical networks.
At the physical level the IP address is not useful but the hosts and routers are recognized
by their MAC addresses.
A MAC address is a local address. It is unique locally but it is not unique universally.
The IP and MAC address are two different identifiers and both of them are needed
Deliver a packet to a host or a router, we require two levels of addressing namely IP
addressing and MAC addressing.
Most importantly we should be able to map the IP address into a corresponding MAC
address.
Dynamic mapping
In dynamic mapping technique a protocol is used for finding the other address when one
type of address is known.
There are two type of dynamic mapping available.
o Address Resolution Protocol (ARP)
o Reverse Address Resolution Protocol (RARP)
The ARP maps IP address to a MAC address whereas the RARP maps a MAC address to
an IP address.
ARP Operation
ARP is used for associating an IP address to its MAC address.
For a LAN, each device has its own physical or station address as its identification. This
address is imprinted on the NIC.
Find the MAC address:
10
CS8591 - COMPUTER NETWORKS
When a router or a host needs to find the MAC address of another host or network the
sequence of events taking place is as follows:
a. The router or a host A who wants to find the MAC address of some other router,
sends an ARP request packet. This packet consists of IP and MAC addresses of
the sender A and the IP address of the receiver (B).
b. This request packet is broadcasted over the network as shown the figure.
c.
d. Every host and router on the network receives and processes the ARP request
packet. But only the intended receiver (B) recognizes its IP address in the request
packet and sends back an ARP response packet.
e. The ARP response packet contains the IP and physical addresses of the receiver
(B). This packet is delivered only to A (unicast) using A’s physical address in the
ARP request packet. This is shown in the following figure.
11
CS8591 - COMPUTER NETWORKS
OPER (Operation):
It is a 16 bit field which defines the type of packet. The two possible types of packets are:
ARP request (1) and ARP reply (2).
Framing
To transmit frames over the node it is necessary to mention start and end of each frame. There
are three techniques to solve this frame
Byte-Oriented Protocols (BISYNC, PPP, DDCMP)
Bit-Oriented Protocols (HDLC)
Clock-Based Framing (SONET)
12
CS8591 - COMPUTER NETWORKS
The BISYNC protocol illustrates the sentinel approach to framing; its frame format is
Byte-Counting Approach
The number of bytes contained in a frame can he included as a field in the frame header.
DDCMP protocol is used for this approach. The frame format is
COUNT Field specifies how many bytes are contained in the frame’s body.
Sometime count field will be corrupted during transmission, so the receiver will accumulate
as many bytes as the COUNT field indicates. This is sometimes called a framing error.
The receiver will then wait until it sees the next SYN character.
It is arranged as nine rows of 90 bytes each, and the first 3 bytes of each row are overhead,
with the rest being available for data.
The first 2 bytes of the frame contain a special bit pattern, and it is these bytes that enable
the receiver to determine where the frame starts.
13
CS8591 - COMPUTER NETWORKS
The receiver looks for the special bit pattern consistently, once in every 810 bytes, since each
frame is 9 x 90 = 810 bytes long.
The figure shows that the data-link layer at the sending node tries to push frames toward the
data-link layer at the receiving node. If the receiving node cannot process and deliver the packet
to its network at the same rate that the frames arrive, it becomes overwhelmed with frames. Flow
control in this case can be feedback from the receiving node to the sending node to stop or slow
down pushing frames.
Buffers
Although flow control can be implemented in several ways, one of the solutions is normally to
use two buffers; one at the sending data-link layer and the other at the receiving data-link layer.
A buffer is a set of memory locations that can hold packets at the sender and receiver. The flow
control communication can occur by sending signals from the consumer to the producer. When
the buffer of the receiving data-link layer is full, it informs the sending data-link layer to stop
pushing frames.
Error Control
Error control at the data-link layer is normally very simple and implemented using one of the
following two methods. In both methods, a CRC is added to the frame header by the sender and
checked by the receiver.
❑ In the first method, if the frame is corrupted, it is silently discarded; if it is not corrupted, the
packet is delivered to the network layer. This method is used mostly in wired LANs such as
Ethernet.
❑ In the second method, if the frame is corrupted, it is silently discarded; if it is not corrupted, an
acknowledgment is sent (for the purpose of both flow and error control) to the sender.
14
CS8591 - COMPUTER NETWORKS
Connectionless Protocol
In a connectionless protocol, frames are sent from one node to the next without any
relationship between the frames; each frame is independent. Note that the term connectionless
here does not mean that there is no physical connection (transmission medium) between the
nodes; it means that there is no connection between frames. The frames are not numbered and
there is no sense of ordering. Most of the data-link protocols for LANs are connectionless
protocols.
Connection-Oriented Protocol
In a connection-oriented protocol, a logical connection should first be established
between the two nodes (setup phase). After all frames that are somehow related to each other are
transmitted (transfer phase), the logical connection is terminated (teardown phase). In this type
of communication, the frames are numbered and sent in order. If they are not received in order,
the receiver needs to wait until all frames belonging to the same set are received and then deliver
them in order to the network layer. Connection oriented protocols are rare in wired LANs, but we
can see them in some point-to-point protocols, some wireless LANs, and some WANs.
15
CS8591 - COMPUTER NETWORKS
HDLC denotes both the beginning and the end of a frame with the distinguished bit sequence
01111110.
This sequence might appear anywhere in the body of the frame, it can be avoided by bit
stuffing.
On the sending side, any time five consecutive 1’s have been transmitted from the body of the
message (i.e., excluding when the sender is trying to transmit the distinguished 01111110
sequence), the sender inserts a 0 before transmitting the next bit.
On the receiving side, five consecutive 1’s arrived, the receiver makes its decision based on
the next bit it sees (i.e., the bit following the five is).
If the next bit is a 0, it must have been stuffed, and so the receiver removes it. If the next bit is
a 1, then one of two things is true, either this is the end-of-frame marker or an error has been
introduced into the bit stream.
By looking at the next bit, the receiver can distinguish between these two cases:
1.If it sees a 0 (i.e., the last eight bits it has looked at are 01111110), then it is the end-of- frame
marker.
2.If it sees a 1 (i.e., the last eight bits it has looked at are 01111111), then there must have been
an error and the whole frame is discarded.
CSMA/CD
Token Passing CDMA
CSMA/CA
RANDOM ACCESS
In random access or contention methods, no station is superior to another station and
none is assigned to control over another.
No station permits, or does not permit another station to send.
16
CS8591 - COMPUTER NETWORKS
CSMA
To minimize the chance of collision and increase the performance CSMA method was
developed.
The chance of collision can be reduced if a station senses the medium before trying to use
it.
Carrier sense multiple access (CSMA) requires that each station first listen to the medium
(or check the state of the medium) before sending.
In other words, CSMA is based on the principle “sense before transmit” or “listen before
talk.
CSMA can reduce the possibility of collision, but it cannot eliminate it.
17
CS8591 - COMPUTER NETWORKS
At time t1, station B senses the medium and finds it idle, so it sends a frame.
At time t2 (t2>t1), station C senses the medium and finds it idle because, at this time, the
first bits from station B have not reached station C.
Station C also sends a frame.
The two signals collide and both frames are destroyed.
Vulnerable Time
Vulnerable Time
Persistence Methods:
18
CS8591 - COMPUTER NETWORKS
19
CS8591 - COMPUTER NETWORKS
CSMA/CD tells the station what to do when a collision is detected. CSMA/CA tries to avoid the
collision.
20
CS8591 - COMPUTER NETWORKS
This is so because the station, once the entire frame is sent, does not keep a copy of the
frame and does not monitor the line for collision detection. Therefore, the frame
transmission time Tff must be at least two times the maximum propagation time T p.
Example
A network using CSMA/CD has a bandwidth of 10 Mbps.
If the maximum propagation time (including the delays in the devices and ignoring the time
needed to send a jamming signal) is 25.6µs, what is the minimum size of the frame?
Solution: The frame transmission time is Tff = 2 X Tp = 51.2µs. This means, in the worst case,
a station needs to transmit for a period of 51.2µs to detect the collision. The minimum size of
the frame is 10 Mbps X 51.2µs = 512 bits or 64 bytes.
Energy Level:
Level of energy in a channel can have three values: Zero, normal, and abnormal.
At the zero level, the channel is idle.
At the normal level, a station has successfully captured the channel and is sending its
frame.
At the abnormal level, there is a collision and the level of the energy is twice the normal
level.
A station that has a frame to send or is sending a frame needs to monitor the energy level
to determine if the channel is idle, bust or in collision mode.
21
CS8591 - COMPUTER NETWORKS
In a wired network, the received signal has almost the same energy as the sent signal
because either the length of the cable is short or there are repeaters that amplify the
energy between the sender and the receiver.
This means that in a collision, the detected energy almost doubles.
In a wireless network, much of the sent energy is lost in transmission.
The received signal has very little energy.
Therefore, a collision may add only 5 to 10 percent additional energy.
This is not useful for effective collision detection.
To avoid collisions on wireless networks because they cannot be detected carrier sense
multiple access with collision avoidance (CSMA/CA) was invented for this network.
Collisions are avoided through the use of CSMA/CA’s three strategies: the inter-frame
space, the contention window, and acknowledgements.
Timing in CSMA/CA
22
CS8591 - COMPUTER NETWORKS
Contention Window:
The contention window is an amount of time divided into slots.
A station that is ready to send chooses a random number of slots as its wait time.
The number of slots in the window changes according to the binary exponential back-off
strategy.
This means that it is set to one slot the first time and then doubles each time the station
cannot detect an idle channel after the IFS time.
The contention window is that the station needs to sense the channel after each time slot.
In CSMA/CA, if the station finds the channel busy, it does not restart the timer of the
contention window; it stops the timer and restarts it when the channel becomes idle.
Acknowledgment
With all these precautions, there still may be a collision resulting in destroyed data.
In addition, the data may be corrupted during the transmission.
The positive acknowledgment and the time-out timer can help guarantee that the receiver
has received the frame.
NOTE
Exponential backoff:
The strategy of doubling the delay interval between each retransmission attempt is a general
technique known as exponential backoff.
ALOHA
Pure ALOHA
The original ALOHA protocol is called pure ALOHA. This is a simple but elegant protocol. The
idea is that each station sends a frame whenever it has a frame to send (multiple access).
However, since there is only one channel to share, there is the possibility of collision between
frames from different stations. Figure 12.2 shows an example of frame collisions in pure
ALOHA.
23
CS8591 - COMPUTER NETWORKS
Slotted ALOHA
Pure ALOHA has a vulnerable time of 2 * Tfr. This is so because there is no rule that defines
when the station can send. A station may send soon after another station has started or just before
another station has finished. Slotted ALOHA was invented to improve the efficiency of pure
ALOHA.
In slotted ALOHA we divide the time into slots of Tfr seconds and force the station to send only
at the beginning of the time slot. Figure 12.5 shows an example of frame collisions in slotted
ALOHA.
Reservation
In the reservation method, a station needs to make a reservation before sending data.
Time is divided into intervals. In each interval, a reservation frame precedes the data frames sent
in that interval.
If there are N stations in the system, there are exactly N reservation minislots in the reservation
frame. Each minislot belongs to a station. When a station needs to send a data frame, it makes a
reservation in its own minislot. The stations that have made reservations can send their data
frames after the reservation frame.
Figure 12.18 shows a situation with five stations and a five-minislot reservation frame. In the
first interval, only stations 1, 3, and 4 have made reservations. In the second interval, only station
1 has made a reservation
24
CS8591 - COMPUTER NETWORKS
Polling
Polling works with topologies in which one device is designated as a primary station and
the other devices are secondary stations. All data exchanges must be made through the primary
device even when the ultimate destination is a secondary device.
The primary device controls the link; the secondary devices follow its instructions. It is
up to the primary device to determine which device is allowed to use the channel at a given time.
The primary device, therefore, is always the initiator of a session (see Figure 12.19). This
method uses poll and select functions to prevent collisions. However, the drawback is if the
primary station fails, the system goes down.
Token Passing
In the token-passing method, the stations in a network are organized in a logical ring. In
other words, for each station, there is a predecessor and a successor. The predecessor is the
station which is logically before the station in the ring; the successor is the station which is after
the station in the ring. The current station is the one that is accessing the channel now. The right
to this access has been passed from the predecessor to the current station. The right will be
passed to the successor when the current station has no more data to send.
But how is the right to access the channel passed from one station to another? In this
method, a special packet called a token circulates through the ring. The possession of the token
25
CS8591 - COMPUTER NETWORKS
gives the station the right to access the channel and send its data. When a station has some data
to send, it waits until it receives the token from its predecessor. It then holds the token and sends
its data. When the station has no more data to send, it releases the token, passing it to the next
logical station in the ring. The station cannot send data until it receives the token again in the
next round. In this process, when a station receives the token and has no data to send, it just
passes the data to the next station
Token management is needed for this access method. Stations must be limited in the time
they can have possession of the token. The token must be monitored to ensure it has not been lost
or destroyed. For example, if a station that is holding the token fails, the token will disappear
from the network. Another function of token management is to assign priorities to the stations
and to the types of data being transmitted. And finally, token management is needed to make
low-priority stations release the token to high-priority stations
Logical Ring
In a token-passing network, stations do not have to be physically connected in a ring; the ring
can be a logical one. Figure 12.20 shows four different physical topologies that can create a
logical ring.
In the physical ring topology, when a station sends the token to its successor, the token cannot be
seen by other stations; the successor is the next one in line. This means that the token does not
have to have the address of the next successor. The problem with this topology is that if one of
the links—the medium between two adjacent stations—fails, the whole system fails.
The dual ring topology uses a second (auxiliary) ring which operates in the reverse
direction compared with the main ring. The second ring is for emergencies only (such as a spare
tire for a car). If one of the links in the main ring fails, the system automatically combines the
two rings to form a temporary ring. After the failed link is restored, the auxiliary ring becomes
26
CS8591 - COMPUTER NETWORKS
idle again. Note that for this topology to work, each station needs to have two transmitter ports
and two receiver ports. The high-speed Token Ring networks called FDDI (Fiber Distributed
Data Interface) and CDDI (Copper Distributed Data Interface) use this topology.
In the bus ring topology, also called a token bus, the stations are connected to a single
cable called a bus. They, however, make a logical ring, because each station knows the address
of its successor (and also predecessor for token management purposes). When a station has
finished sending its data, it releases the token and inserts the address of its successor in the token.
Only the station with the address matching the destination address of the token gets the token to
access the shared media. The Token Bus LAN, standardized by IEEE, uses this topology.
In a star ring topology, the physical topology is a star. There is a hub, however, that acts
as the connector. The wiring inside the hub makes the ring; the stations are connected to this ring
through the two wire connections. This topology makes the network less prone to failure because
if a link goes down, it will be bypassed by the hub and the rest of the stations can operate. Also
adding and removing stations from the ring is easier. This topology is still used in the Token
Ring LAN designed by IBM.
f
f5
f4
f3
f2
f1
27
CS8591 - COMPUTER NETWORKS
f1 f2 f3 f4 f5 f6 T
Code c
C5
c4
c3
c2 wired LAN - Ethernet (IEEE 802.3) and its frame format (OR)
8. Explain in detail about
Explain the physical properties of Ethernet 802.3 with necessary diagram (NOV
c1
2014)(May,Nov 2015 & 2016)
Introduction: Frequency f
The IEEE 802.3 standards committee developed a widely used LAN standard called
Ethernet, which covers both the MAC layer and the physical layer.
The Ethernet is a multiple-access network, meaning that a set of nodes send and receive
frames over a shared link.
The IEEE 802.3 standard uses CSMA for controlling media access and the 1-persistent
algorithm explained earlier, although the lost time owing to collisions is very small.
Also, IEEE 802.3 uses a back-off scheme known as binary exponential backoff.
The use of random backoff minimizes subsequent collisions.
This back-off scheme requires a random delay to be doubled after each retransmission.
The user drops the frame after 16 retries.
The combination of the 1-persistent scheme and binary exponential backoff results in an
efficient scheme.
The Ethernet versions have different data rates.
28
CS8591 - COMPUTER NETWORKS
Version 1000BaseSX, carrying 1 Gb/s, and 10GBase-T, carrying 10 Gb/s, hold the most
promise for the future of high-speed LAN development
Ethernet Evolution
Physical properties:
An Ethernet segment is implemented on a coaxial cable of up to 500m.
This cable is similar to the type used for cable TV, except that it typically has an
impedance of 50 ohms instead of cable TV’s 75 ohms.
Hosts connect to an Ethernet segment by tapping into it; taps must be at least 2.5 m apart.
A transceiver – a small device directly attached to the tap – detects when the line is idle
and drives the signal when the host is transmitting.
It also receives incoming signals.
The transceiver is, in turn, connected to an Ethernet adaptor, which is plugged into the
host.
29
CS8591 - COMPUTER NETWORKS
Rather than using a 50-ohm coax cable, an Ethernet can be constructed from a thinner
cable known as 10Base2; the original cable is called 10Base5 (the two cables are
commonly called thin-net and thick-net, respectively).
The “10” in 10Base2 means that the network operates at 10 Mbps, “Base” refers to the
fact that the cable is used in a baseband system, and the “2” means that a given segment
can be no longer than 200 m.
Today, a third cable technology is predominantly used, called 10BaseT, where the “T”
stands for twisted pair.
A 10BaseT segment is usually limited to less than 100 m in length.
Data transmitted by any one host on the Ethernet reaches all the other hosts.
This is the good news.
The bad news is that all these hosts are competing for access to the same link, and as a
consequence, they are said to be in the same collision domain.
Access Protocol:
30
CS8591 - COMPUTER NETWORKS
Preamble is 7 bytes and consists of a pattern of alternating 0s and 1s. This field is
used to provide bit synchronization.
Start of frame consists of a 10101011 pattern and indicates the start of the frame to
the receiver.
Destination address specifies the destination MAC address.
Source address specifies the source MAC address.
Length/Type specifies the frame size, in bytes. The maximum Ethernet frame
size is 1,518 bytes.
LLC data is data from the LLC layer.
Pad is used to increase the frame length to the value required for collision detection to
work.
Frame check sequence is 32-bit CRC for error checking.
31
CS8591 - COMPUTER NETWORKS
9. Discuss the functioning (Key requirements) of wireless LAN in detail. (May 2015, Nov
2015) May 2016
Wireless technologies differ from wired links in some important ways, while at the same
time sharing many common properties. Like wired links, issues of bit errors are of great
32
CS8591 - COMPUTER NETWORKS
concern—typically even more so due to the unpredictable noise environment of most wireless
links. Framing and reliability also have to be addressed.
Unlike wired links, power is a big issue for wireless, especially because wireless links are
often used by small mobile devices (like phones and sensors) that have limited access to power
(e.g., a small battery). Furthermore, you can’t go blasting away at arbitrarily high power with a
radio transmitter—there are concerns about interference with other devices and usually
regulations about how much power a device may emit at any given frequency.
Introduction IEEE has defined the specification for the wireless LAN called IEEE 802.11,
which covers the physical and Data Link Layers.
Architecture
A BSS is made of stationary (immobile) or mobile wireless stations and a possible central base
station known as the access point AP.
33
CS8591 - COMPUTER NETWORKS
The BSS without an AP is stand alone network and cannot send data to other BSS. It is called an
ad hoc architecture.
An ESS is made up of two or more BSS with AP. The BSS are connected through a distribution
system, which is usually a wired LAN.
An ESS uses two types of stations mobile and stationary. The mobile stations are normal
stations inside a BSS. The stationary stations are AP stations that are part of the wired LAN.
When BSS are connected, the network is called an infrastructure network. In this the stations
within reach of one another can communicate without the use of an AP. But communication
between two stations in two different BSS usually occurs via two AP’s.
Station Types
Three qualitatively different levels of mobility in a wireless LAN.
1. No transmission
2. BSS transition
3. ESS transition
1) No transmission:
The first level is no mobility, such as when a receiver must be in a fixed location to receive a
directional transmission form the base station of a single BSS.
2) BSS transition:
It is defined as a station movement from one BSS to another BSS within the same ESS
(Bluetooth).
3) ESS transition
It is defined as a station movement from a BSS in one ESS to a BSS with in another ESS. The
third level is mobility between bases, as is the case with cell phones and Wi-Fi.
34
CS8591 - COMPUTER NETWORKS
10. Discuss IEEE 802.11 (or) WI-FI in detail (or) MAC layer functions in IEEE802.11
(May 2015, 2016, 2017)(Dec 2017)
802.11 is designed for use in a limited geographical area (homes, office buildings,
campuses), and its primary challenge is to mediate access to a shared communication medium—
in this case, signals propagating through space.
Physical properties
IEEE 802.11 defines the specification for the conversion of bits to a signal in the physical layer.
The IEEE 802.11 physical layer is of four types.
2. Direct-sequence spread spectrum (DSSS): It uses seven channels, each supporting data
rates of 1 Mb/s to 2 Mb/s. The operating frequency range is 2.4 GHz ISM band.
In DSSS each bit by the sender is a replaced by the sequence of bits called chip code. To avoid
buffering, the time needed to send one chip code must be the same as the time needed to send
one original bit.
3. IEEE 802.11a: Orthogonal frequency division multiplexing (OFDM): IEEE 802.11a uses
OFDM, which uses 12 orthogonal channels in the 5 GHz range. All the sub bands are
used by one source at a given time. The common data rates are 18 Mbps and 54 Mbps.
4. IEEE 802.11b: High Rate Direct-Sequence spread spectrum (HRDSSS): IEEE 802.11b
operates in the 2.4 GHz band and supports data rates of 5.5 Mb/s to 11 Mb/s. It is similar
to DSSS except for the encoding method which is called complementary code keying
(CCK). CCK encodes four or eight bits to one CCK symbol.
5. IEEE 802.11g: (OFDM): IEEE 802.11g operates at 2.4 GHz and supports even higher
data rates.
35
CS8591 - COMPUTER NETWORKS
Protocol Stack
IEEE 802.11 provides several key functionalities: reliable data delivery, media access control,
and security features.
The DCF algorithm uses contention resolution, and its sublayer implements the CSMA scheme
for media access control and contention resolution.
Begin DCF Algorithm for Wireless 802.11 MAC – MACA (NOV/DEC 2014)
1. The sender senses the medium for any ongoing traffic.
2. If the medium is idle, the sender waits for a time interval equal to IFS. Then the sender
senses the medium again. If the medium is still idle, the sender transmits the frame
immediately.
1. After the station is found ideal, the station waits for a period of time, called the
distributed inter-frame space (DIFS).
3. The station sends a control frame called the request to send (RTS).After receiving the
RTS and waiting a short period called the short inter-frame space (SIFS), the destination
station sends a control frame called clear to send (CTS), to the source station. This
control frame indicates that the destination station is ready to receive data.
36
CS8591 - COMPUTER NETWORKS
Two or more stations made try to send RTS frames at the same time, these control frames
may collide. The sender assumes there has been a collision if it has not received CTS
frame from the receiver and it tries again.
4. The source station sends data after waiting an amount of time equal to SIFS.
5. The destination station after waiting for an amount of time equal to SIFS sends and
acknowledgement to show that the frame has been received.
6. When a station sends an RTS frame, it includes the duration of the time that it needs to
occupy the channel. The stations that are affected by this transmission create a timer
called a Network Allocation Vector (NAV) that all shows how much time must pass
before these stations are allowed to check the channel for idleness.
WLAN data transmission collisions can still happen, and MACA for Wireless
(MACAW) is brought to extend the functionality of MACA. It demands nodes to send
acknowledgments after every successful frame transmission. MACAW is commonly used in ad
hoc networks. Moreover, it is the basis of various other MAC protocols found in wireless sensor
networks (WSN).
Collision Avoidance:
A wireless protocol would follow the same algorithm as the Ethernet – wait until the link
becomes idle before transmitting and back off should a collision occur – and to a first
approximation, this is what 802.11 does.
Consider the situation depicted in the below figure, where A and C are both within range
of B but not each other.
Suppose both A and C want to communicate with B and so they each send it a frame.
A and C are unaware of each other since their signals do not carry that far.
37
CS8591 - COMPUTER NETWORKS
These two frames collide with each other at B, but unlike an Ethernet, neither A nor C is
aware of this collision.
A and C are said to be hidden nodes with respect to each other.
A related problem, called the exposed node problem, occurs under the circumstances
illustrated in the below figure, where each of the four nodes is able to send and receive
signals that reach just the nodes to its immediate left and right.
For example, B can exchange frames with A and C but it cannot reach D, while C can
reach B and D but not A.
Distribution system
Some nodes are allowed to roam (e.g., your laptop) and some are connected to a wired
network infrastructure. 802.11 calls these base stations access points (APs), and they are
connected to each other by a so-called distribution system. Figure 2.32 illustrates a distribution
system that connects three access points, each of which services the nodes in some region. Each
access point operates on some channel in the appropriate frequency range, and each AP will
typically be on a different channel than its neighbors
Although two nodes can communicate directly with each other if they are within reach of
each other, the idea behind this configuration is that each node associates itself with one access
point.
For node A to communicate with node E, for example, A first sends a frame to its access
point (AP-1), which forwards the frame across the distribution system to AP-3, which finally
transmits the frame to E. How AP-1 knew to forward the message to AP-3 is beyond the scope of
802.11; it may have used the bridging protocol described in the next chapter (Section 3.1.4).
What 802.11 does specify is how nodes select their access points and, more interestingly, how
this algorithm works in light of nodes moving from one cell to another.
38
CS8591 - COMPUTER NETWORKS
The technique for selecting an AP is called scanning and involves the following four steps:
1. The node sends a Probe frame.
2. All APs within reach reply with a Probe Response frame.
3. The node selects one of the access points and sends that AP an Association Request frame.
4. The AP replies with an Association Response frame.
MAC Frame
The three frame types in IEEE 802.11 are control frames, data-carrying frames, and management
frames.
The frame format for the 802.11 MAC is shown in the below diagram and is described as
follows.
The frame control (FC) field provides information on the type of frame: control
frame, data frame, or management frame.
Duration/connection ID (D/I) refers to the time allotted for the successful
transmission of the frame.
The addresses field denotes the 6-byte source and destination address fields.
The sequence control (SC) field consists of 4 bits reserved for fragmentation and
reassembly and 12 bits for a sequence number of frames between a particular
transmitter and receiver.
The frame body field contains a MAC service data unit or control information.
The cyclic redundancy check (CRC) field is used for error detection.
39
CS8591 - COMPUTER NETWORKS
Control frames ensure reliable data delivery. The control frames are used for accessing the
channel and acknowledgement frames. It consist of
Management frames are used to monitor and manage communication among various users in the
IEEE 802.11 LAN through access points.
Introduction
Bluetooth is a wireless LAN technology designed to connect devices of different
functions such as telephones, notebooks, computers (desktop and laptop), cameras, printers, and
even coffee makers when they are at a short distance from each other. A Bluetooth LAN is an ad
hoc network, which means that the network is formed spontaneously; the devices, sometimes
called gadgets, find each other and make a network called a piconet. A Bluetooth LAN can even
be connected to the Internet if one of the gadgets has this capability. A Bluetooth LAN, by
nature, cannot be large. If there are many gadgets that try to connect, there is chaos.
Bluetooth technology has several applications. Peripheral devices such as a wireless mouse or
keyboard can communicate with the computer through this technology. Monitoring devices can
communicate with sensor devices in a small health care center. Home security devices can use
this technology to connect different sensors to the main security controller. Conference attendees
can synchronize their laptop computers at a conference.
Bluetooth was originally started as a project by the Ericsson Company. It is named for Harald
Blaatand, the king of Denmark (940-981) who united Denmark and Norway. Blaatand translates
to Bluetooth in English.
Today, Bluetooth technology is the implementation of a protocol defined by the IEEE 802.15
standard. The standard defines a wireless personal-area network (PAN) operable in an area the
size of a room or a hall.
Architecture
Bluetooth defines two types of networks: piconet and scatternet.
Piconets
40
CS8591 - COMPUTER NETWORKS
A Bluetooth network is called a piconet, or a small net. A piconet can have up to eight
stations, one of which is called the primary; the rest are called secondaries. All the secondary
stations synchronize their clocks and hopping sequence with the primary. Note that a piconet can
have only one primary station. The communication between the primary and secondary stations
can be one-to-one or one-to-many. Figure 15.17 shows a piconet.
Although a piconet can have a maximum of seven secondaries, additional secondaries can be in
the parked state. A secondary in a parked state is synchronized with the primary, but cannot take
part in communication until it is moved from the parked state to the active state. Because only
eight stations can be active in a piconet, activating a station from the parked state means that an
active station must go to the parked state.
Scatternet
Piconets can be combined to form what is called a scatternet. A secondary station in one piconet
can be the primary in another piconet. This station can receive messages from the primary in the
first piconet (as a secondary) and, acting as a primary, deliver them to secondaries in the second
piconet. A station can be a member of two piconets. Figure 15.18 illustrates a scatternet.
Bluetooth Devices
41
CS8591 - COMPUTER NETWORKS
A Bluetooth device has a built-in short-range radio transmitter. The current data rate is 1
Mbps with a 2.4-GHz bandwidth. This means that there is a possibility of interference between
the IEEE 802.11b wireless LANs and Bluetooth LANs.
Bluetooth Layers
Bluetooth uses several layers that do not exactly match those of the Internet model we
have defined in this book. Figure 15.19 shows these layers.
L2CAP
The Logical Link Control and Adaptation Protocol, or L2CAP (L2 here means LL), is
roughly equivalent to the LLC sublayer in LANs. It is used for data exchange on an ACL link;
SCO channels do not use L2CAP. Figure 15.20 shows the format of the data packet at this level.
Baseband Layer
The baseband layer is roughly equivalent to the MAC sublayer in LANs. The access
method is TDMA
Frame Format
42
CS8591 - COMPUTER NETWORKS
Radio Layer
The radio layer is roughly equivalent to the physical layer of the Internet model.
Bluetooth devices are low-power and have a range of 10 m.
Band
Bluetooth uses a 2.4-GHz ISM band divided into 79 channels of 1 MHz each.
FHSS
Bluetooth uses the frequency-hopping spread spectrum (FHSS) method in the physical
layer to avoid interference from other devices or other networks
Modulation
To transform bits to a signal, Bluetooth uses a sophisticated version of FSK, called GFSK
Hosts and networks do not normally operate in isolation. We use connecting devices to connect
hosts together to make a network or to connect networks together to make an internet.
Connecting devices can operate in different layers of the Internet model. We discuss three kinds
of connecting devices: hubs, link-layer switches, and routers. Hubs today operate in the first
layer of the Internet model. Link-layer switches operate in the first two layers. Routers operate in
the first three layers
Hubs
A hub is a device that operates only in the physical layer. Signals that carry information
within a network can travel a fixed distance before attenuation endangers the integrity of the
data. A repeater receives a signal and, before it becomes too weak or corrupted, regenerates and
retimes the original bit pattern.
The repeater then sends the refreshed signal. In the past, when Ethernet LANs were using
bus topology, a repeater was used to connect two segments of a LAN to overcome the length
restriction of the coaxial cable. Today, however, Ethernet LANs use star topology. In a star
topology, a repeater is a multiport device, often called a hub, that can be used to serve as the
connecting point and at the same time function as a repeater.
43
CS8591 - COMPUTER NETWORKS
Figure 17.2 shows that when a packet from station A to station B arrives at the hub, the
signal representing the frame is regenerated to remove any possible corrupting noise, but the hub
forwards the packet from all outgoing ports except the one from which the signal was received.
In other words, the frame is broadcast. All stations in the LAN receive the frame, but only station
B keeps it. The rest of the stations discard it.
Figure 17.2 shows the role of a repeater or a hub in a switched LAN. The figure
definitely shows that a hub does not have a filtering capability; it does not have the intelligence
to find from which port the frame should be sent out. A hub or a repeater is a physical-layer
device. They do not have a link-layer address and they do not check the link-layer address of the
received frame. They just regenerate the corrupted bits and send them out from every port.
Link-Layer Switches
Introduction
A switch is a combination of a hub and a bridge.
It can interconnect two or more workstations, but like a bridge, it observes traffic flow
and learns.
When a frame arrives at a switch, the switch examines the destination address and
forwards the frame out the one necessary connection.
1. Workstations that connect to a hub are on a shared segment.
2. Workstations that connect to a switch are on a switched segment.
The backplane of a switch is fast enough to support multiple data transfers at one time.
A switch that employs a cut-through architecture is one that passes on the frame before
the entire frame has arrived at the switch.
Multiple workstations connected to a switch use dedicated segments. This is a very
efficient way to isolate heavy users from the network.
A switch can allow simultaneous access to multiple servers, or multiple simultaneous
connections to a single server.
A link-layer switch (or switch) operates in both the physical and the data-link layers.
As a physical-layer device, it regenerates the signal it receives. As a link-layer device,
the link-layer switch can check the MAC addresses (source and destination) contained
in the frame.
44
CS8591 - COMPUTER NETWORKS
Filtering
One may ask what the difference in functionality is between a link-layer switch and hub. A link-
layer switch has filtering capability. It can check the destination address of a frame and can
decide from which outgoing port the frame should be sent.
Transparent Switches
A transparent switch is a switch in which the stations are completely unaware of the
switch’s existence. If a switch is added or deleted from the system, reconfiguration of the
stations is unnecessary. According to the IEEE 802.1d specification, a system equipped with
transparent switches must meet three criteria:
❑ Frames must be forwarded from one station to another.
❑ The forwarding table is automatically made by learning frame movements in the network.
❑ Loops in the system must be prevented
Advantages of switches
1. Switches divide a network into several isolated channels or collision domains
2. Reduce the possibility of collision
3. Each channel has its own network capacity
4. Connecting Heterogenous Devices
Limitations of switches
1. Although contains buffers to accommodate bursts of traffic, can become overwhelmed by
heavy traffic
2. Device cannot detect collision when buffer full
3. Some higher level protocols do not detect error
The preceding strategy works just fine until the extended LAN has a loop in it, in which
case it fails in a horrible way—frames potentially loop through the extended LAN forever.
45
CS8591 - COMPUTER NETWORKS
This is easy to see in the example depicted in Figure 3.10, where, for example, bridges B1, B4,
and B6 form a loop.
Whatever the cause, bridges must be able to correctly handle loops.
This problem is addressed by having the bridges run a distributed spanning tree algorithm.
If you think of the extended LAN as being represented by a graph that possibly has loops
(cycles), then a spanning tree is a subgraph of this graph that covers (spans) all the vertices but
contains no cycles. That is, a spanning tree keeps all of the vertices of the original graph but
throws out some of the edges. For example, Figure 3.11 shows a cyclic graph on the left and one
of possibly many spanning trees on the right.
The idea of a spanning tree is simple enough: It’s a subset of the actual network topology
that has no loops and that reaches all the LANs in the extended LAN. The hard part is how all of
the bridges coordinate their decisions to arrive at a single view of the spanning tree. After all,
one topology is typically able to be covered by multiple spanning trees. The answer lies in the
spanning tree protocol.
46
CS8591 - COMPUTER NETWORKS
The main idea of the spanning tree is for the bridges to select the ports over which they will
forward frames.
Each bridge has a unique identifier; for our purposes, we use the labels B1, B2, B3, and
so on.
The algorithm first elects the bridge with the smallest ID as the root of the spanning tree;
Next, each bridge computes the shortest path to the root and notes which of its ports is on
this path.
Finally, all the bridges connected to a given LAN elect a single designated bridge that
will be responsible for forwarding frames toward the root bridge
Routers
A router is a three-layer device; it operates in the physical, data-link, and network layers. As a
physical-layer device, it regenerates the signal it receives. As a link-layer device, the router
checks the physical addresses (source and destination) contained in the packet. As a network-
layer device, a router checks the network-layer addresses.
A router can connect networks. In other words, a router is an internetworking device; it connects
independent networks to form an internetwork. According to this definition, two networks
connected by a router become an internetwork or an internet. There are three major differences
between a router and a repeater or a switch.
1. A router has a physical and logical (IP) address for each of its interfaces.
2. A router acts only on those packets in which the link-layer destination address matches the
address of the interface at which the packet arrives.
3. A router changes the link-layer address of the packet (both source and destination) when it
forwards the packet.
47
CS8591 - COMPUTER NETWORKS
Let us give an example. In Figure 17.9, assume an organization has two separate buildings with a
Gigabit Ethernet LAN installed in each building. The organization uses switches in each LAN.
The two LANs can be connected to form a larger LAN using 10 Gigabit Ethernet technology that
speeds up the connection to the Ethernet and the connection to the organization server. A router
then can connect the whole system to the Internet.
UNIVERSITY QUESTIONS
16 MARKS
1.Explain and differentiate FDDI and Ethernet (16) (Q.NO. 2,13 & 14)
2.Write short notes on.
(i)Transparent bridges (8) (Q.NO. 6)
(ii)MACA and MACAW (8) (Q.NO. 4)
2 MARKS
1. What do you understand by CSMA protocol? (Q.NO. 43)
2. List the functions of bridges (Q.NO. 44)
16 MARKS
1. Explain in detail about access method and frame format used in Ethernet and token
ring (16) (Q.NO. 2 & 16 )
2. (i) Discuss the MAC layer functions of IEEE802.11 (8) (Q.NO. 4)
(ii) Briefly define key requirements of wireless LAN (8) (Q.NO. 3)
48
CS8591 - COMPUTER NETWORKS
2 MARKS
1. Define sub-netting. (Q.NO 28)
2. What is the need of ARP? (Q.NO 36)
3. Identify the class of the following IP address: (a) 110.34.56.45 (b) 212.208.63.23 (Q.NO 47)
16 MARKS
1. Write short notes on Ethernet & Wireless LAN (8+8) (Q.NO 2 & 3)
2. Explain in detail ARP, DHCP, ICMP (16) (Q.NO 8, 9 & 10)
16 MARKS
1. Give the comparison between different wireless technologies? Enumerate 802.11 protocol stack in
detail (16) (Q.NO 3 & 4)
2. Write short notes on DHCP & ICMP (8+8) (Q.NO 9 & 10)
B.E/B.Tech Nov-Dec 2016
2 MARKS
1. What is meant by exponential backoff? (Q.NO 5 )
2. What is scatternet? (Q.NO 46)
3. What is fragmentation and reassembly? (Q.NO 48)
16 MARKS
1. Explain the physical properties of Ethernet 802.3 with necessary diagram of Ethernet
transceiver and adapter (16) (Q.NO 2)
2. With a neat sketch explain about IP service model,packet format,Fragmentation and
reassembly.(16) (Q.NO 11)
PART A
1. State the functions of bridges. (Q.NO 44)
2. When is ICMP redirect message used? (Q.NO 49)
PART B
1.i) Discuss the working of CSMA/CD protocol (6) (Q.NO 15)
ii) Explain the functions of MAC layer present in IEEE802.11 with necessary diagrams (7)
(Q.NO 4)
2. Explain the working of DHCP protocol with its header format (Q.NO 9)
49
CS8591 - COMPUTER NETWORKS
PART A
1. Show the Ethernet frame format (Q.NO 37)
2. Highlights the characteristics of datagram networks (Q.NO 50)
PART B
1. Explain the functions of Wi-Fi & Bluetooth in detail (13) (Q.NO 4 & 5)
2. i)Explain the datagram forwarding in IP (Q.NO 11)
ii)Show and explain the ARP packet format for mapping IP addresses into Ethernet addresses
(Q.NO 8)
50
CS8591 - COMPUTER NETWORKS
PART A
1. List the various services provided in the Network Layer.
Packetizing
Routing and Forwarding
Other Services
o Error Control
o Flow Control
o Congestion Control
o Quality of Service
o Security
2. Define packetizing.
Packetizing: encapsulating the payload (data received from upper layer) in a
network-layer packet at the source and decapsulating the payload from the network-
layer packet at the destination.
4. Define packet switched network and list the different approaches to route
the packet.
Packet Switched Network:
Packet switching is used at the network layer because the unit of data at this layer is a
packet.
At the network layer, a message from the upper layer is divided into manageable
packets and each packet is sent through the network.
A packet-switched network can use two different approaches to route the packets:
o The datagram approach - Connectionless Service
o The virtual circuit approach - Connection-Oriented Service
1
CS8591 - COMPUTER NETWORKS
9. Queuing Delay
The queuing delay for a packet in a router is measured as the time a packet waits in
the input queue and output queue of a router.
2
CS8591 - COMPUTER NETWORKS
In a path from source to destination, a packet may pass through several links
(networks), each with a different transmission rate.
Throughput = minimum {TR1, TR2, . . . TRn}.
12. Define IPv4 Address and list the various types of notations.
An IPv4 address is a 32-bit address that uniquely and universally defines the
connection of a host or a router to the Internet.
IPv4 addresses are unique. If a device has two connections to the Internet, via two
networks, it has two IPv4 addresses.
Notation
There are three common notations to show an IPv4 address: binary notation (base 2),
dotted-decimal notation (base 256), and hexadecimal notation (base 16).
3
CS8591 - COMPUTER NETWORKS
15. Specify the various types of Classes and its range in Classful Addressing.
4
CS8591 - COMPUTER NETWORKS
Solution
There are 232 – 24 = 256 addresses in this block.
The first address is 14.24.74.0/24; the last address is 14.24.74.255/24.
Subblock with 120 addresses:
The number of addresses in the largest subblock, which requires 120 addresses, is not a
power of 2. We allocate 128 addresses.
The subnet mask for this subnet can be found as n1 = 32 − log 2128 = 25. The first address
in this block is 14.24.74.0/25; the last address is
14.24.74.127/25.
Subblock with 60 addresses:
The number of addresses in the second largest subblock, which requires 60 addresses, is
not a power of 2 either. We allocate 64 addresses.
The subnet mask for this subnet can be found as n2 = 32 − log264 = 26.
The first address in this block is 14.24.74.128/26; the last address is 14.24.74.191/26.
Subblock with 60 addresses:
The number of addresses in the smallest subblock, which requires 10 addresses, is not a
power of 2 either. We allocate 16 addresses.
The subnet mask for this subnet can be found as n3 = 32 − log 216 = 28.
The first address in this block is 14.24.74.192/28; the last address is
5
CS8591 - COMPUTER NETWORKS
14.24.74.207/28.
If we add all addresses in the previous subblocks, the result is 208 addresses. The first
address in this range is 14.24.74.208. The last address is 14.24.74.255.
18. Make a forwarding table for router R1 using the configuration in Figure
Solution:
6
CS8591 - COMPUTER NETWORKS
When a datagram is fragmented, each fragment has its own header with most of the
fields repeated, but some have been changed.
A datagram may be fragmented several times before it reaches the final destination.
7
CS8591 - COMPUTER NETWORKS
25. List and define the two debugging tools used in ICMPv4 messages. Or
Define Ping and Traceroute
Two debugging tools: ping and traceroute.
Ping
Ping program is used to find if a host is alive and responding.
The source host sends ICMP echo-request messages; the destination, if alive,
responds with ICMP echo-reply messages.
The ping program gets help from two query messages;
Traceroute or Tracert
The traceroute program in UNIX or tracert in Windows can be used to trace the path
of a packet from a source to the destination.
It can find the IP addresses of all the routers that are visited along the path.
The traceroute program gets help from two error-reporting messages: time-exceeded
and destination-unreachable.
8
CS8591 - COMPUTER NETWORKS
In distance-vector routing, normally we want to update an existing least cost with a least
cost through an intermediary node, such as z, if the latter is shorter.
The Border Gateway Protocol version 4 (BGP4) is the only interdomain routing protocol,
based on the path-vector algorithm.
BGP allows routers to carry specific policies or constraints that they must meet.
In BGP, two contributing (casual) routers can exchange routing information even if they
are located in two different autonomous systems.
32. Write the keys for understanding the distance vector routing?
The three keys for understanding the algorithm are,
Knowledge about the whole networks
Routing only to neighbors
Information sharing at regular intervals
10
CS8591 - COMPUTER NETWORKS
33. Write the keys for understanding the link state routing?
The three keys for understanding the algorithm are,
Knowledge about the neighborhood.
Routing to all neighbors.
Information sharing when there is a range.
34. How the packet cost referred in distance vector and link state routing?
In distance vector routing, cost refer to hop count while in case
of link state routing, cost is a weighted value based on a variety of factors such as
security levels, traffic or the state of the link.
11
CS8591 - COMPUTER NETWORKS
42. What is the difference between boundary level masking and non-boundary
level masking.
Boundary level Masking:
If the masking is at the boundary level, the mask numbers are either 255 or 0,
finding the subnetwork address is very easy.
Non Boundary level Masking
If the masking is not at the boundary level, the mask numbers are not just 255 or
0, finding the subnetwork address involves using the bitwise AND operators.
12
CS8591 - COMPUTER NETWORKS
44. Identify the class and default subnet mask of the IP address
217.65.10.7.
It belongs to class C.
Default subnet mask – 255.255.255.192
PART B
13
CS8591 - COMPUTER NETWORKS
The routers in the path are not allowed to decapsulate the packets they received unless
the packets need to be fragmented.
The routers are not allowed to change source and destination addresses either.
Routing and Forwarding
Routing
The network layer is responsible for routing the packet from its source to the
destination.
A physical network is a combination of networks (LANs and WANs) and routers that
connect them.
The network layer is responsible for finding the best one among these possible routes.
Forwarding
Forwarding can be defined as the action applied by each router when a packet arrives
at one of its interfaces.
The decision-making table a router normally uses for applying this action is
sometimes called the forwarding table and sometimes the routing table.
When a router receives a packet from one of its attached networks, it needs to forward
the packet to another attached network or to some attached networks.
Other Services
1. Error Control
The designers of the network layer, however, have added a checksum field to the
datagram to control any corruption in the header, but not in the whole datagram.
This checksum may prevent any changes or corruptions in the header of the datagram.
The Internet uses an auxiliary protocol, ICMP, that provides some kind of error
control if the datagram is discarded or has some unknown information in the header.
2. Flow Control
Flow control regulates the amount of data a source can send without overwhelming
the receiver.
To control the flow of data, the receiver needs to send some feedback to the sender to
inform the latter that it is overwhelmed with data.
The network layer in the Internet, however, does not directly provide any flow
control.
14
CS8591 - COMPUTER NETWORKS
3. Congestion Control
Another issue in a network-layer protocol is congestion control. Congestion in the
network layer is a situation in which too many datagrams are present in an area of the
Internet.
Congestion may occur if the number of datagrams sent by source computers is
beyond the capacity of the network or routers.
If the congestion continues, sometimes a situation may reach a point where the
system collapses and no datagrams are delivered.
4. Quality of Service
As the Internet has allowed new applications such as multimedia communication, the
quality of service (QoS) of the communication has become more and more important.
5. Security
The network layer was designed with no security provision.
To provide security for a connectionless network layer, we need to have another
virtual level that changes the connectionless service to a connection-oriented service.
This virtual layer, called IPSec.
.
15
CS8591 - COMPUTER NETWORKS
16
CS8591 - COMPUTER NETWORKS
Request packet
A request packet is sent from the source to the destination.
packets from A, it assigns a label to the incoming packets that come from
A, in this case 77. This label lets the destination know that the packets
Come from A, and not from other sources.
Acknowledgment Packet
A special packet, called the acknowledgment packet, completes the entries in the
switching tables.
2. Data-Transfer Phase
The second phase is called the data-transfer phase.
The source computer uses the label 14, which it has received from router R1 in the
setup phase. Router R1 forwards the packet to router R3, but changes the label to 66.
Router R3 forwards the packet to router R4, but changes the label to 22.
Finally, router R4 delivers the packet to its final destination with the label 77.
All the packets in the message follow the same sequence of labels, and the packets
arrive in order at the destination.
3. Teardown Phase
In the teardown phase, source A, after sending all packets to B, sends a special
packet called a teardown packet.
Destination B responds with a confirmation packet.
All routers delete the corresponding entries from their tables.
3. Explain the performance of network layer in detail.
The performance of a network can be measured in terms of
o delay,
o throughput,
o packet loss.
Congestion control is an issue that can improve the performance.
1 Delay
19
CS8591 - COMPUTER NETWORKS
All of us expect instantaneous response from a network, but a packet, from its source to
its destination, encounters delays.
The delays in a network can be divided into four types:
o transmission delay,
o propagation delay,
o processing delay,
o queuing delay.
Transmission Delay
A sender needs to put the bits in a packet on the line one by one.
If the first bit of the packet is put on the line at time t1 and the last bit is put on the line
at time t2, transmission delay of the packet is (t2 − t1).
The transmission delay is longer for a longer packet and shorter if
the sender can transmit faster. In other words, the transmission delay is
Propagation Delay
Propagation delay is the time it takes for a bit to travel from point A to point B in the
transmission media.
The propagation delay depends on the propagation speed of the media, which is 3 × 108
meters/second in a vacuum and normally much less in a wired medium; it also depends
on the distance of the link.
Processing Delay
The processing delay is the time required for a router or a destination host to receive a
packet from its input port, remove the header, perform an error detection procedure,
and deliver the packet to the output port (in the case of a router) or deliver the packet
to the upper-layer protocol (in the case of the destination host).
Queuing Delay
The queuing delay for a packet in a router is measured as the time a packet waits in
the input queue and output queue of a router.
Total Delay
If we have n routers, we have (n + 1) links.
Therefore, we have (n + 1) transmission delays related to n routers and the source, (n
+ 1) propagation delays related to (n + 1) links, (n + 1) processing delays related to n
routers and the destination, and only n queuing delays related to n routers.
20
CS8591 - COMPUTER NETWORKS
2 Throughput
Throughput at any point in a network is defined as the number of bits passing through
the point in a second, which is actually the transmission rate of data at that point.
In a path from source to destination, a packet may pass through several links
(networks), each with a different transmission rate.
Throughput = minimum {TR1, TR2, . . . TRn}.
3 Packet Loss
When a router receives a packet while processing another packet, the received packet
needs to be stored in the input buffer waiting for its turn.
A router, however, has an input buffer with a limited size. A time may come when the
buffer is full and the next packet needs to be dropped.
This effect is packet loss.
4 Congestion Control
Congestion control is a mechanism for improving performance.
Congestion control refers to techniques and mechanisms that can either prevent
congestion before it happens or remove congestion after it has happened.
Two broad categories:
o open-loop congestion control (prevention)
o closed-loop congestion control (removal).
Open-Loop Congestion Control
In open-loop congestion control, policies are applied to prevent congestion before
it happens.
In these mechanisms, congestion control is handled by either the source or the
destination.
The policies are Retransmission Policy, Window Policy, Acknowledgment
Policy, Discarding Policy, Admission Policy.
Closed-Loop Congestion Control.
Closed-loop congestion control mechanisms try to alleviate congestion after it
happens.
Several mechanisms have been used by different protocols.
o Backpressure
o Choke Packet
o Implicit Signalling
o Explicit Signalling
21
CS8591 - COMPUTER NETWORKS
IPV4 ADDRESSES
1. Address Space
2. Classful Addressing
3. Classless Addressing
IPV4 ADDRESSES
The identifier used in the IP layer of the TCP/IP protocol suite to identify the
connection of each device to the Internet is called the Internet address or IP address.
The IP address is the address of the connection, not the host or the router, because if
the device is moved to another network, the IP address may be changed.
An IPv4 address is a 32-bit address that uniquely and universally defines the
connection of a host or a router to the Internet.
IPv4 addresses are unique. If a device has two connections to the Internet, via two
networks, it has two IPv4 addresses.
1. Address Space
A protocol like IPv4 that defines addresses has an address space.
An address space is the total number of addresses used by the protocol.
IPv4 uses 32-bit addresses, which means that the address space is 232 or
4,294,967,296 (more than four billion
Notation
There are three common notations to show an IPv4 address: binary notation (base 2),
dotted-decimal notation (base 256), and hexadecimal notation (base 16).
In binary notation, an IPv4 address is displayed as 32 bits.
Dotted-decimal notation is decimal point (dot) separating the bytes.
IPv4 address in hexadecimal notation. Each hexadecimal digit is equivalent to four
bits. This means that a 32-bit address has 8 hexadecimal digits.
Hierarchy in Addressing
A 32-bit IPv4 address is also hierarchical, but divided only into two parts. The first part
of the address, called the prefix, defines the network; the second part of the address,
called the suffix, defines the node (connection of a device to the Internet).
The prefix length is n bits and the suffix length is (32 − n) bits. A prefix can be fixed
length or variable length.
22
CS8591 - COMPUTER NETWORKS
2 Classful Addressing
An IPv4 address was designed with a fixed-length prefix. The whole address
space was divided into five classes (class A, B, C, D, and E). This scheme is referred to
as classful addressing.
Addresses in classes A, B and C are for unicast communication, from one source to one
destination.
23
CS8591 - COMPUTER NETWORKS
Addresses in class D are for multicast communication, from one source to a group of
destination. A multicast address is used only in destination addresses.
Addresses in class E are reserved. The original idea was to use them for special purpose.
Subnetting and Supernetting
To alleviate address depletion, two strategies were proposed and implemented: subnetting
and supernetting.
In subnetting, a class A or class B block is divided into several subnets. Each subnet has a
larger prefix length than the original network.
Subnetting allows the addresses to be divided among several organizations.
Supernetting was devised to combine several class C blocks into a larger block to be
attractive to organizations that need more than the 256 addresses available in a class C
block.
Advantage of Classful Addressing
Given an address, we can easily find the class of the address and, since the
prefix length for each class is fixed, we can find the prefix length
immediately.
Examples:
1. Find the class for the following IP addresses. (i) 205.55.43.11 and
(ii) 100.23.28.65
Solution:
i) Class C (First byte 205 between 192 to 223)
ii) Class A (First byte 100 between 0 to 127)
3 Classless Addressing
In addressing, the whole address space is divided into variable length classless blocks.
The prefix in an address defines the block (network); the suffix defines the node
(device).
A prefix length ranges from 0 to 32. The size of the network is inversely
24
CS8591 - COMPUTER NETWORKS
proportional to the length of the prefix. A small prefix means a larger network; a large
prefix means a smaller network.
Prefix Length: Slash Notation
The prefix length, n, is added to the address, separated by a slash.
The notation is informally referred to as slash notation and formally as classless
interdomain routing or CIDR strategy.
An address in classless addressing can then be represented as shown in
Address Mask
The address mask is a 32-bit number in which the n leftmost bits are set to 1s and the rest
of the bits (32 − n) are set to 0s.
To extract the information in a block, using the three bit-wise operations NOT, AND, and
OR.
1. The number of addresses in the block N = NOT (mask) + 1.
2. The first address in the block = (Any address in the block) AND (mask).
3. The last address in the block = (Any address in the block) OR [(NOT
(mask)].
Network Address
The network address is actually the identifier of the network; because it is used in routing
a packet to its destination network.
FORWARDING OF IP PACKETS
Forwarding Based on Destination Address
Forwarding Based on Label
Routers as Packet Switches
FORWARDING OF IP PACKETS
Forwarding means to place the packet in its route to its destination.
When IP is used as a connectionless protocol, forwarding is based on the destination
address of the IP datagram; when the IP is used as a connection-oriented protocol,
forwarding is based on the label attached to an IP datagram.
Forwarding Based on Destination Address
Forwarding requires a host or a router to have a forwarding table.
When a host has a packet to send or when a router has received a packet to be
forwarded, it looks at this table to find the next hop to deliver the packet to.
25
CS8591 - COMPUTER NETWORKS
26
CS8591 - COMPUTER NETWORKS
Version Number.
o The 4-bit version number (VER) field defines the version of the IPv4
protocol, which, obviously, has the value of 4.
Header Length.
o The 4-bit header length (HLEN) field defines the total length of the datagram
header in 4-byte words. The IPv4 datagram has a variable-length header.
Service Type.
o Type of service (TOS), defines how the datagram should be handled.
Total Length.
o This 16-bit field defines the total length (header plus data) of the IP datagram
in bytes
Identification, Flags, and Fragmentation Offset.
o These three fields are related to the fragmentation of the IP datagram when the
size of the datagram is larger than the underlying network can carry.
Time-to-live.
o The time-to-live (TTL) field is used to control the maximum number of hops
(routers) visited by the datagram. When a source host sends the datagram, it
stores a number in this field.
o Each router that processes the datagram decrements this number by one. If
this value, after being decremented, is zero, the router discards the datagram.
Protocol.
o In TCP/IP, the data section of a packet, called the payload, carries the whole
packet from another protocol.
27
CS8591 - COMPUTER NETWORKS
Fragmentation
The division of a packet into smaller units to accommodate a protocol’s MTU.
Maximum Transfer Unit (MTU)
The largest size data unit a specific network can handle.
The value of the MTU differs from one physical network protocol to another.
When a datagram is fragmented, each fragment has its own header with most of the
fields repeated, but some have been changed.
A datagram may be fragmented several times before it reaches the final destination.
The host or router that fragments a datagram must change the values of
three fields: flags, fragmentation offset, and total length.
28
CS8591 - COMPUTER NETWORKS
ICMPv4
MESSAGES
Debugging Tools
ICMP Checksum
The Internet Control Message Protocol version 4 (ICMPv4) helps IPv4 to handle some
errors that may occur in the network-layer delivery.
ICMP is used to report some errors that may occur during the processing of the IP
datagram. ICMP does not correct errors, it simply reports them.
MESSAGES
ICMP messages are divided into two broad categories:
error-reporting messages and query messages
An ICMP message has an 8-byte header and a variable-size data section.
The first field, ICMP type, defines the type of the message.
The code field specifies the reason for the particular message type.
The last common field is the checksum field.
The rest of the header is specific for each message type.
The data section in error messages carries information for finding the original packet that
had the error.
In query messages, the data section carries extra information based on the type of query.
29
CS8591 - COMPUTER NETWORKS
30
CS8591 - COMPUTER NETWORKS
The time-exceeded message (with code 1) can also be sent when not all fragments
of a datagram arrive within a predefined period of time.
5. Parameter Problem
A parameter problem message (type 12) can be sent when either there is a
problem in the header of a datagram (code 0) or some options are missing or
cannot be interpreted (code 1).
Query Messages
Query messages are used to probe or test the liveliness of hosts or routers in the
Internet.
The query messages come in pairs: request and reply.
The echo request (type 8) and the echo reply (type 0) pair of messages are used by a
host or a router to test the liveliness of another host or router. A host or router sends
an echo request message to another host or router; if the latter is alive, it responds
with an echo reply message.
Debugging Tools
Two debugging tools: ping and traceroute.
Ping
Ping program is used to find if a host is alive and responding.
The source host sends ICMP echo-request messages; the destination, if alive,
responds with ICMP echo-reply messages.
The ping program gets help from two query messages;
Traceroute or Tracert
The traceroute program in UNIX or tracert in Windows can be used to trace the path
of a packet from a source to the destination.
It can find the IP addresses of all the routers that are visited along the path.
the traceroute program gets help from two error-reporting messages: time-exceeded
and destination-unreachable.
ICMP Checksum
In ICMP the checksum is calculated over the entire message (header and data).
Example
An example of checksum calculation for a simple echo-request message. We
randomly chose the identifier to be 1 and the sequence number to be 9. The message is
divided into 16-bit (2-byte) words. The words are added and the sum is complemented.
Now the sender can put this value in the checksum field.
31
CS8591 - COMPUTER NETWORKS
32
CS8591 - COMPUTER NETWORKS
(a→y), (b→y), and (c→y) as previously established least-cost paths and (x→y)
as the new least-cost path.
Distance Vectors
A least-cost tree is a combination of least-cost paths from the root of the tree to all
destinations.
These paths are graphically glued together to form the tree.
33
CS8591 - COMPUTER NETWORKS
1 Distance_Vector_Routing ( )
2 {
3 // Initialize (create initial vectors for the node)
4 D[myself ] = 0
5 for (y = 1 to N)
6 {
7 if (y is a neighbour)
8 D[y] = c[myself ][y]
9 else
10 D[y] = ∞
11 }
12 send vector {D[1], D[2], …, D[N]} to all neighbours
Link-State Routing
This method uses the term link-state to define the characteristic of a link (an edge)
that represents a network in the internet.
34
CS8591 - COMPUTER NETWORKS
Links with lower costs are preferred to links with higher costs; if the cost of a link is
infinity, it means that the link does not exist or has been broken.
Link-State Database (LSDB)
The LSDB can be represented as a two-dimensional array(matrix) in which the value
of each cell defines the cost of the corresponding link.
35
CS8591 - COMPUTER NETWORKS
Dijkstra’s Algorithm
1 Dijkstra’s Algorithm ( )
2 {
3 // Initialization
4 Tree = {root} // Tree is made only of the root
5 for (y = 1 to N) // N is the number of nodes
6 {
7 if (y is the root)
8 D[y] = 0
// D[y] is shortest distance from root to node y
9 else if (y is a neighbour)
10 D[y] = c[root][y]
// c[x][y] is cost between nodes x and y in LSDB
11 else
12 D[y] = ∞
13 }
14 // Calculation
15 repeat
16 {
17 find a node w, with D[w] minimum among all nodes not
in the Tree
18 Tree = Tree ∪ {w} // Add w to tree
19 // Update distances for all neighbours of w
20 for (every node x, which is a neighbour of w and not in the Tree)
21 {
22 D[x] = min{D[x], (D[w] + c[w][x])}
23 }
24 } until (all nodes included in the Tree)
25 } // End of Dijkstra
36
CS8591 - COMPUTER NETWORKS
Example:
Path-Vector Routing
In path-vector routing, the path from a source to all destinations is also
determined by the best spanning tree.
The best spanning tree, however, is not the least-cost tree; it is the tree determined
by the source when it imposes its own policy.
Path-vector routing, is an asynchronous and distributed routing
algorithm.
37
CS8591 - COMPUTER NETWORKS
1 Path_Vector_Routing ( )
2 {
3 // Initialization
4 for (y = 1 to N)
5 {
6 if (y is myself)
7 Path[y] = myself
8 else if (y is a neighbour)
9 Path[y] = myself + neighbour node
10 else
11 Path[y] = empty
12 }
13 Send vector {Path[1], Path[2], …, Path[y]} to all neighbours
14 // Update
15 repeat (forever)
16 {
17 wait (for a vector Path from a neighbour w)
18 for (y = 1 to N)
19 {
20 if (path includes myself)
21 discard the path // Avoid any loop
22 else
23 Path[y] = best {Path[y], (myself + Path w[y])}
24 }
25 If (there is a change in the vector)
26 Send vector {Path[1], Path[2], …, Path[y]} to all
neighbours
27 }
28 } // End of Path Vector
38
CS8591 - COMPUTER NETWORKS
40
CS8591 - COMPUTER NETWORKS
OSPF Messages
OSPF is a very complex protocol; it uses five different types of messages.
The hello message (type 1) is used by a router to introduce itself to the neighbours
and announce all neighbours that it already knows.
The database description message (type 2) is normally sent in response to the hello
message to allow a newly joined router to acquire the full LSDB.
The link-state request message (type 3) is sent by a router that needs information
about a specific LS.
The link-state update message (type 4) is the main OSPF message used for building
the LSDB.
The link-state acknowledgment message (type 5) is used to create reliability in
OSPF; each router that receives a link-state update message needs to acknowledge it.
OSPF Algorithm
OSPF implements the link-state routing.
Performance of OSPF:
Update Messages.
Convergence of Forwarding Tables.
Robustness.
41
CS8591 - COMPUTER NETWORKS
Each router keeps the database of the subnetworks that it can reach and tries to get the
best route for that subnetwork.
BGP Packets / Messages
Open packet. This packet requests establishment of a relationship between two
routers.
Update packet. This packet conveys update information about routes.
Keep-alive packet. Once a relationship between two routers is established, this
packet confirms its neighbor relationship frequently.
Notification packet. This packet is used when an error occurs.
Performance
BGP speakers exchange a lot of messages to create forwarding tables, but
BGP is free from loops and count-to-infinity.
MULTICASTING BASICS
Multicast Addresses
Delivery at Data-Link Layer
Collecting Information about Groups
Multicast Forwarding
Two Approaches to Multicasting
42
CS8591 - COMPUTER NETWORKS
Multicast Addresses
o In multicast communication, the sender is only one, but the receiver is
many.
A multicast address defines a group of recipients, not a single one.
In other words, a multicast address is an identifier for a group.
A host, which is a member of n groups, actually has (n + 1) addresses: one unicast
address that is used for source or destination address in unicast communication and n
multicast addresses that are used only for destination addresses to receive messages
sent to a group.
In classful addressing, all of class D was composed of these addresses; classless
addressing used the same block, but it was
referred to as the block 224.0.0.0/4 (from 224.0.0.0 to 239.255.255.255).
43
CS8591 - COMPUTER NETWORKS
44
CS8591 - COMPUTER NETWORKS
If there are m groups and n sources in the internet, a router needs to create (m × n)
routing trees.
In each tree, the corresponding source is the root, the members of the group are
the leaves, and the router itself is somewhere on the tree.
2. Group-Shared Tree Approach
In the group-shared tree approach, the designated router, which is called the
core router or the rendezvous point router, acts as the representative for the group.
Any source that has a packet to send to a member of that group sends it to the core
center (unicast communication) and the core center is responsible for
multicasting.
The core center creates one single routing tree with itself as the root and any
routers with active members in the group as the leaves.
In this approach, there are m core routers (one for each group) and each core
router has a routing tree, for the total of m trees.
This means that the number of routing trees is reduced from (m × n) in the source-
based tree approach to m in this approach.
Representation / Notations
Binary notation is used when the addresses are stored in a computer.
The colon hexadecimal notation divides the address into eight sections,
each made of four hexadecimal digits separated by colons.
Abbreviation :
Zero Compression
45
CS8591 - COMPUTER NETWORKS
The IPv6 address, even in hexadecimal format is very long. But in this address there
are many of the zero digits in it. In such a case, we can abbreviate the address. The
leading zeros of a section (four digits between two colons) can be omitted.
Note that only the leading zeros can be dropped but the trailing zeros cannot drop.
Mixed Notation
Mixed representation of an IPv6 address: colon hex and dotted decimal notation.
This is appropriate during the transition period in which an IPv4 address is embedded
in an IPv6 address (as the rightmost 32 bits).
For example, the address (::130.24.24.18) is a legitimate address in IPv6.
CIDR Notation
IPv6 uses hierarchical addressing. For this, IPv6 allows slash or CIDR notation.
For example, the following shows how we can define a prefix of 60 bits using CIDR.
Address Space
The address space of IPv6 contains 2128 addresses. This address space is 296 times
the IPv4 address.
Three Address Types
In IPv6, a destination address can belong to one of three categories:
o unicast,
o anycast,
o multicast.
1. Unicast Address
A unicast address defines a single interface (computer or router).
The packet sent to a unicast address will be routed to the intended recipient.
2. Anycast Address
An anycast address defines a group of computers that all share a single address.
46
CS8591 - COMPUTER NETWORKS
A packet with an anycast address is delivered to only one member of the group,
the most reachable one.
3. Multicast Address
A multicast address also defines a group of computers.
In multicasting each member of the group receives a copy.
Version. The 4-bit version field defines the version number of the IP. For IPv6, the
value is 6.
Traffic class. The 8-bit traffic class field is used to distinguish different payloads
with different delivery requirements. It replaces the type-of-service field in IPv4.
Flow label. The flow label is a 20-bit field that is designed to provide special
handling for a particular flow of data. We will discuss this field later.
Payload length. The 2-byte payload length field defines the length of the IP datagram
excluding the header.
Hop limit. The 8-bit hop limit field serves the same purpose as the TTL field in IPv4.
Source and destination addresses. The source address field is a 16-byte (128-bit)
Internet address that identifies the original source of the datagram. The destination
address field is a 16-byte (128-bit) Internet address that identifies the destination of
the datagram.
Payload. Compared to IPv4, the payload field in IPv6 has a different format and
meaning.
47
CS8591 - COMPUTER NETWORKS
Extension Header
An IPv6 packet is made of a base header and some extension headers.
The length of the base header is fixed at 40 bytes.
Extension headers are hop-by-hop option, source routing, fragmentation,
authentication, encrypted security payload, and destination option.
Hop-by-Hop Option
The hop-by-hop option is used when the source needs to pass information to all
routers visited by the datagram.
Only three hop-by-hop options have been defined:
o Pad1, PadN, and jumbo payload.
Pad1. This option is 1 byte long and is designed for alignment purposes.
PadN. PadN is used when 2 or more bytes are needed for alignment.
Jumbo payload. Length of the payload in the IP datagram can be a maximum of
65,535 bytes.
Destination Option
The destination option is used when the source needs to pass information to the
destination only.
48
CS8591 - COMPUTER NETWORKS
The format of the destination option is the same as the hop-by-hop option.
Source Routing
The source routing extension header combines the concepts of the strict source
route and the loose source route options of IPv4.
Fragmentation
The concept of fragmentation in IPv6 is the same as that in IPv4.
In IPv6, only the original source can fragment.
Authentication
The authentication extension header has a dual purpose: it validates the message
sender and ensures the integrity of data.
Encrypted Security Payload
The encrypted security payload (ESP) is an extension that provides confidentiality
and guards against eavesdropping.
Advantages of IPv6:
Larger address space
o IPv6 has 128-bit address space, which is 4 times wider in bits in
compared to IPv4’s 32-bit address space.
Better header format
o IPv6 uses a better header format. In its header format the options are separated
from the base header.
New option
o New options have been added in IPv6 to increase the functionality.
Possibility of extension
o IPv6 has been designed in such a way that there is a possibility of extension of
protocol if required.
More security
o IPv6 includes security in the basic specification.
o It includes encryption of packets (ESP: Encapsulated Security
Payload) and authentication of the sender of packets (AH:
Authentication Header).
Support to resource allocation
o To implement better support for real time traffic (such as video conference), IPv6
includes flow label in the specification.
o With flow label mechanism, routers can recognize to which end-to-end flow the
packets belong.
Plug and play
o IPv6 includes plug and play in the standard specification.
o It therefore must be easier for novice users to connect their machines to the
network, it will be done automatically.
Clearer specification and optimization
49
CS8591 - COMPUTER NETWORKS
12. For the following networks, develop the datagram forwarding table for all
the nodes. The links are labeled with relative costs. The tables should
forward each packet via the least cost path to destination.
50
CS8591 - COMPUTER NETWORKS
51
CS8591 - COMPUTER NETWORKS
52
CS8591 - COMPUTER NETWORKS
Networks – Network Types – Protocol Layering – TCP/IP Protocol suite – OSI Model – Physical
Layer: Performance – Transmission media – Switching – Circuit-switched Networks – Packet
Switching
PART A
3. What are the three criteria necessary for an effective and efficient network?
The most important criteria are
Performance
Reliability
Security
Performance of the network depends on number of users, type of transmission medium, and the
capabilities of the connected h/w and the efficiency of the s/w. Reliability is measured by
frequency of failure, the time it takes a link to recover from the failure and the network’s
robustness in a catastrophe. Security issues include protecting data from unauthorized access and
viruses.
10. What is spread spectrum and explain the two types of spread spectrum?
Spread spectrum is to spread the signal over a wider frequency band than normal in such
a way as to minimize the impact of interference from other devices.
Frequency Hopping
Direct sequence
2
17. For n devices in a network, what is the number of cable links required for a mesh and
ring topology?
Mesh topology – n (n-1)/2
Ring topology – n
18. What are the two types of line configuration? (NOV 2010)
Point-to-point & Multipoint
21. What is the use of Two dimensional parity in error detection? (NOV 2012)
It is based on simple parity.
It performs calculation for each bit position across each byte in the frame.
This adds extra parity byte for entire frame, in addition to a parity bit for each byte.
22. What are the issues (Services) in data link layer? (NOV 2012) (May 2016) (Nov 2016)
a) Services Provided to the Network Layer
b) Framing
c) Error Control
d) Flow Control
30. What is protocol? What are its key elements? (NOV/DEC 2007) (May 2016)
Set of rules that govern the data communication is protocol. The key elements are
i) Syntax ii) Semantics iii) Timing
31. Define (or) mechanism of stop and wait protocol (Nov 2016)
The idea of stop-and-wait is straightforward: After transmitting one frame, the sender
waits for an acknowledgment before transmitting the next frame. If the acknowledgment does
not arrive after a certain period of time, the sender times out and retransmits the original frame.
36. Write down any two differences between circuit switching and packet switching
(Nov/Dec 2014) (May 2017)
Circuit switching
In circuit switching network dedicated channel has to be established before the call is
made between users
The channel is reserved between the users till the connection is active
Packet switching
In packet switching network unlike CS network, it is not required to establish the
connection initially
The connection/channel is available to use by many users.
5
40. List the types of transmission media
Communication can be made by 2 ways
1. Guided (Wired)
2. Unguided (Wireless
Type of switching
Circuit Switching
Packet Switching
Message Switching
6
PART B
Advantages of Network
Speed. Sharing and transferring files within Networks are very rapid. Thus saving time,
while maintaining the integrity of the file.
Cost. Individually licensed copies of many popular software programs can be costly.
Networkable versions are available at considerable savings. Shared programs, on a network
allows for easier upgrading of the program on one single file server, instead of upgrading
individual workstations.
Security. Sensitive files and programs on a network are passwords protected or designated as
"copy inhibit," so that you do not have to worry about illegal copying of programs.
Centralized Software Management. Software can be loaded on one computer (the file
server) eliminating that need to spend time and energy installing updates and tracking files on
independent computers throughout the building.
Resource Sharing. Resources such as, printers, fax machines and modems can be shared.
Electronic Mail. E-mail aids in personal and professional communication.
Flexible Access. Access their files from computers throughout the firm.
Workgroup Computing. Workgroup software (such as Microsoft BackOffice) allows many
users to work on a document or project concurrently.
Disadvantages of Network
7
2. Explain in detail about Networks & Discuss the types and connections of networks
Network :
A network is any collection of independent computers that communicate with one another over
a shared network medium. A computer network is a collection of two or more connected
computers. When these computers are joined in a network, people can share files and peripherals
such as modems, printers, tape backup drives, or CD-ROM drives.
Network Criteria:
Performance of the network depends on number of users, type of transmission medium, and the
capabilities of the connected h/w and the efficiency of the s/w. Reliability is measured by
frequency of failure, the time it takes a link to recover from the failure and the network’s
robustness in a catastrophe. Security issues include protecting data from unauthorized access and
viruses
TYPE OF CONNECTION:
There are two types are,
1. Point to point
2. Multi point
1. Point To Point:
It provides a dedicated link between two devices of the channel. The entire capacity of the
channel is reserved for transmission between those two devices.
2. Multipoint:
More than two devices can share a link by using this type of connection. It also called as
multidrop. The capacity channel is shared either temporary or spatially. It simultaneously use, it
is spatially shared. If it takes turns, it is time shared line configuration
Types of Network
WAN (Wide Area Network) A WAN spans a large geographic area, such as a state, province
or country. WANs often connect multiple smaller networks, such as local area networks (LANs)
or metro area networks (MANs). The world's most popular WAN is the Internet.
9
3. Discuss about topology and its types
Network Topologies
Topology refers to the way a network is laid out either physically or logically. Two or more
devices connect to a link; two or more links form a topology. It is the geographical
representation of the relationship of all the links and linking devices to each other.
1. Mesh
2. Star
3. Tree
4. Bus
5. Ring
6. Hybrid
1. Mesh Topology:
Here every device has a dedicated point to point link to every other device. A fully connected
mesh can have n(n-1)/2 physical channels to link n devices. It must have n-1 IO ports.
Advantages:
1. They use dedicated links so each link can only carry its own data load. So traffic problem can
be avoided.
2. It is robust. If any one link get damaged it cannot affect others
3. It gives privacy and security
4. Fault identification and fault isolation are easy.
Disadvantages:
1. The amount of cabling and the number IO ports required are very large. Since every device is
connected to each other devices through dedicated links.
2. The sheer bulk of wiring is larger then the available space
3. Hardware required to connect each device is highly expensive.
Example:
A mesh network has 8 devices. Calculate total number of cable links and IO ports needed.
Solution:
Number of devices = 8
Number of links = n (n-1)/2
= 8(8-1)/2
= 28
Number of port/device = n-1
= 8-1 = 7
2. STAR TOPOLOGY:
Here each device has a dedicated link to the central ‘hub’. There is no direct traffic
between devices. The transmission are occurred only through the central controller namely hub.
10
Advantages:
1. Less expensive then mesh since each device is connected only to the hub.
2. Installation and configuration are easy.
3. Less cabling is need then mesh.
4. Robustness.
5. Easy to fault identification & isolation.
Disadvantages:
1. Even it requires less cabling then mesh when compared with other topologies it still large.
3. TREE TOPOLOGY:
It is a variation of star. Instead of all devices connected to a central hub here most of the
devices are connected to a secondary hub that in turn connected with central hub. The central
hub is an active hub. An active hub contains a repeater, which regenerate the received bit pattern
before sending.
The secondary hub may be active or passive. A passive hub means it just precedes a physical
connection only.
Advantages:
1. Can connect more than star.
2. The distance can be increased.
3. Can isolate and prioritize communication between different computers.
4. BUS TOPOLOGY:
A bus topology is multipoint. Here one long cable is act as a backbone to link all the
devices are connected to the backbone by drop lines and taps. A drop line is the connection
between the devices and the cable. A tap is the splice into the main cable or puncture the
sheathing.
Advantages:
11
1. Ease of installation.
2. Less cabling.
Disadvantages:
1. Difficult reconfiguration and fault isolation.
2. Difficult to add new devices.
3. Signal reflection at top can degradation in quality
4. If any fault in backbone can stops all transmission
5. Ring topology
Each node is connected to exactly two other nodes, forming a ring. Can be visualized as a
circular configuration. Requires at least three nodes
Advantages:
1. Easy to install.
2. Easy to reconfigure.
3. Fault identification is easy.
Disadvantages:
1. Unidirectional traffic.
2. Break in a single ring can break entire network.
6. Hybrid topology
A combination of any two or more network topologies.
Scalable Connectivity
Cost-Effective Resource Sharing
Support for Common Services
Manageability
1. Scalable Connectivity
Networks (of which the Internet is the prime example) are designed to grow in a way that
allows them the potential to connect all the computers in the world. A system that is designed to
support growth to an arbitrarily large size is said to scale.
12
The cloud distinguishes between the nodes on the inside that implement the network (they are
commonly called switches, and their primary function is to store and forward packets) and the
nodes on the outside of the cloud that use the network (they are commonly called hosts, and they
support users and run application programs).
Given a collection of nodes indirectly connected by a nesting of networks, it is possible for any
pair of hosts to send messages to each other across a sequence of links and nodes. Of course, we
want to do more than support just one pair of communicating hosts—we want to provide all pairs
of hosts with the ability to exchange messages.
Diagram shows a pair of application-level processes communicating over a logical channel that
is, in turn, implemented on top of a cloud that connects a set of hosts. We can think of the
channel as being like a pipe connecting two applications, so that a sending application can put
data in one end and expect that data to be delivered by the network to the application at the other
end of the pipe
13
4. Manageability
Managing a network includes making changes as the network grows to carry more traffic
or reach more users, and troubleshooting the network when things go wrong or performance isn’t
as desired. This requirement is partly related to the issue of scalability discussed above—as the
Internet has scaled up to support billions of users and at least hundreds of millions of hosts, the
challenges of keeping the whole thing running correctly and correctly configuring new devices
as they are added have become increasingly problematic.
Protocols
A protocol is a set of rules that governs data communication. It defines what is communicated,
how it is communicated, and when it is communicated. The key elements of a protocol are
syntax, semantics and timing.
Each protocol defines two different interfaces.
14
Service interface - to the other objects on the same computer that want to use its
communication services. This service interface defines the operations that local objects can
perform on the protocol.
Peer interface - to its counterpart (peer) on another machine. It also defines the form and
meaning of messages exchanged between protocol peers to implement the communication
service.
Encapsulation
Control information must be added with the data to instruct the peer how to handle with
the received message. It will be added into the header or trailer.
Header - Small data structure from few bytes to few kilobytes attached to the front of message.
Trailer – Information will be added at the end of the message
Payload or message body – Data send by the program
In this case data is encapsulated with new message created by protocol at each level.
15
Organization of the layers
The 7 layers can be grouped into 3 subgroups
2. Transport Layer
Layer4, transport layer, ensures end-to-end reliable data transmission on a single link.
3. User Support Layers
Layers 5,6,7 – Session, presentation and application are the user support layers. They allow
interoperability among unrelated software systems
16
Transmission Mode - The physical layer also defines the direction of transmission
between two devices: simplex, half-duplex or full-duplex.
3. NETWORK LAYER
This layer is responsible for the delivery of packets from source to destination.
It is mainly required, when it is necessary to send information from one network to another.
The other responsibilities of this layer are
Logical addressing - If a packet passes the n/w boundary, we need another addressing
system for source and destination called logical address.
Routing – The devices which connects various networks called routers are responsible for
delivering packets to final destination.
4. TRANSPORT LAYER
It is responsible for Process to Process delivery.
It also ensures whether the message arrives in order or not.
5. SESSION LAYER
This layer establishes, manages and terminates connections between applications.
The other responsibilities of this layer are
Dialog control - This session allows two systems to enter into a dialog either in half duplex
or full duplex.
Synchronization-This allows to add checkpoints into a stream of data.
6. PRESENTATION LAYER
It is concerned with the syntax and semantics of information exchanged between two
systems.
The other responsibilities of this layer are
17
Translation – Different computers use different encoding system, this layer is responsible
for interoperability between these different encoding methods. It will change the message into
some common format.
Encryption and decryption-It means that sender transforms the original information to
another form and sends the resulting message over the n/w. and vice versa.
Compression and expansion-Compression reduces the number of bits contained in the
information particularly in text, audio and video.
7. APPLICATION LAYER
This layer enables the user to access the n/w. This allows the user to log on to remote
user.
The other responsibilities of this layer are
FTAM (file transfer, access, mgmt) - Allows user to access files in a remote host.
Mail services - Provides email forwarding and storage.
Directory services - Provides database sources to access information about various sources
and objects.
Summary of layers
7. Explain TCP/IP protocol suite (Internet architecture) in detail (May 2015) (May
2017)
TCP/IP ARCHITECTURE
TCP/IP model is an implementation of OSI reference model. It has four layers. They are
Network Interface Layer
Internet Layer
Transport (also known as Host-to-Host or Transmission) Layer
Application Layer (known earlier as the Process Layer)
18
19
1) Network interface layer (or) The Host to Network Layer:
Below the internet layer is great void. The TCP/IP reference model does not really say such
about what happen here, except to point out that the host has connect to the network using some
protocol so it can transmit IP packets over it. This protocol is not specified and varies from host
to host and network to network.
2) Internet layer:
Packet switching network depends upon a connectionless internetwork layer. This layer is known
as internet layer, is the linchpin that holds the whole design together. Its job is to allow hosts to
insert packets into any network and have them to deliver independently to the destination. They
may appear in a different order than they were sent in each case it is job of higher layers to
rearrange them in order to deliver them to proper destination.
The internet layer specifies an official packet format and protocol known as internet protocol.
The job of internet layer is to transport IP packets to appropriate destination. Packet routing is
very essential task in order to avoid congestion. For these reason it is say that TCP/IP internet
layer perform same function as that of OSI network layer.
3) Transport layer:
In the TCP/IP model, the layer above the internet layer is known as transport layer. It is
developed to permit entities on the source and destination hosts to carry on a conversation. It
specifies 2 end-to-end protocols
i) TCP (Transmission Control Protocol)
ii) UDP (User Datagram Protocol)
TCP
It is a reliable connection-oriented protocol that permits a byte stream originating on one
machine to be transported without error on any machine in the internet. It divides the incoming
byte stream into discrete message and passes each one onto the internet layer. At the destination,
the receiving TCP process collects the received message into the output stream. TCP deals with
20
flow control to make sure a fast sender cannot swamp a slow receiver with more message than it
can handle.
UDP
It is an unreliable, connectionless protocol for applications that do not want TCP’s
sequencing on flow control and wish to offer their own. It is also used for client-server type
request-reply queries and applications in which prompt delivery is more important than accurate
delivery such as transmitting speech or video.
4) Application Layer:
In TCP/IP model, session or presentation layer are not present. Application layer is
present on the top of the Transport layer. It includes all the higher-level protocols which are
virtual terminal (TELNET), file transfer (FTP) and electronic mail (SMTP).
The virtual terminal protocol permits a user on one machine to log into a distant machine and
work there. The file transfer protocol offers a way to move data efficiently from one machine to
another. Electronic mail was used for file transfer purpose but later a specialized protocol was
developed for it.
SMTP makes use of TCP to establish a connection to the remote mail host, the mail is sent, any
waiting mail is requested and then the connection is disconnected. It can also return a forwarding
address if the intended recipient no longer receives email at that destination. To enable mail to be
delivered across differing systems, a mail gateway is used.
21
iv) Simple Network Management Protocol
For the transport of network management information, SNMP is used as standardized
protocol. Managed network devices can be cross examined by a computer running to return
details about their status and level of activity. Observing software can also trigger alarms if
certain performance criteria drop below acceptable restrictions. At the transport layer SNMP
protocol uses UDP.
The use of UDP results in decreasing network traffic overheads.
Bandwidth
Throughput
Latency (Delay)
Jitter
Bandwidth
The bandwidth of a network is given by the number of bits that can be transmitted over
the network in a certain period of time.
Bandwidth in Hertz
We have discussed this concept. Bandwidth in hertz is the range of frequencies contained in a
composite signal or the range of frequencies a channel can pass. For example, we can say the
bandwidth of a subscriber telephone line is 4 kHz.
The term bandwidth can also refer to the number of bits per second that a channel, a link, or
even a network can transmit. For example, one can say the bandwidth of a Fast Ethernet network
(or the links in this network) is a maximum of 100 Mbps. This means that this network can send
100 Mbps.
Throughput
The throughput is a measure of how fast we can actually send data through a network.
Although, at first glance, bandwidth in bits per second and throughput seem the same, they are
different. A link may have a bandwidth of B bps, but we can only send T bps through this link
with T always less than B. In other words, the bandwidth is a potential measurement of a link; the
throughput is an actual measurement of how fast we can send data.
Latency or delay
The latency or delay defines how long it takes for an entire message to completely arrive
at the destination from the time the first bit is sent out from the source. We can say that latency is
22
made of four components: propagation time, transmission time, queuing time and processing
delay.
Latency = propagation time + transmission time + queuing time + processing delay
Propagation Time
Propagation time measures the time required for a bit to travel from the source to the
destination. The propagation time is calculated by dividing the distance by the propagation
speed.
Propagation time = Distance / (Propagation Speed)
Transmission Time
In data communications we don’t send just 1 bit, we send a message. The first bit may take a
time equal to the propagation time to reach its destination; the last bit also may take the same
amount of time. However, there is a time between the first bit leaving the sender and the last bit
arriving at the receiver. The first bit leaves earlier and arrives earlier; the last bit leaves later and
arrives later. The transmission time of a message depends on the size of the message and the
bandwidth of the channel.
Transmission time = (Message size) / Bandwidth
Jitter
Another performance issue that is related to delay is jitter. We can roughly say that jitter is a
problem if different packets of data encounter different delays and the application using the data
at the receiver site is time-sensitive (audio and video data, for example). If the delay for the first
packet is 20 ms, for the second is 45 ms, and for the third is 40 ms, then the real-time application
that uses the packets endures jitter.
9. Discuss physical links (or) transmission media (or) how communication made by network?
3. Guided (Wired)
4. Unguided (Wireless)
Guided Media
23
Guided media conduct signals from one device to another include Twisted-pair cable,
Coaxial Cable and Fiber-optic cable. A signal traveling along any of these media is directed and
contained by the physical limits of the medium.
Twisted-pair and coaxial cable use metallic (copper) conductors that accept and transport
signals in the form of electric current. Optical fiber is a glass cable that accepts and transports
signals in the form of light.
Interference and cross talk may affect both the wires and create unwanted signals, if the two
wires are parallel.
By twisting the pair, a balance is maintained. Suppose in one twist one wire is closer to
noise and the other is farther in the next twist the reverse is true. Twisting makes it probable that
both wires are equally affected by external influences.
Applications
Twisted Pair cables are used in telephone lines to provide voice and data channels.
Local area networks also use twisted pair cables.
Connectors
The most common UTP connector is RJ45.
Coaxial Cable
Coaxial cable (coax) carries signals of higher frequency ranges than twisted pair cable.
Instead of having two wires, coax has a central core conductor of solid or stranded wire
(usually copper) enclosed in an insulating sheath, and with outer conductor of metal foil.
24
The outer metallic wrapping serves both as a shield against noise and as the second
conductor and the whole cable is protected by a plastic cover.
If the angle of incidence(the angle the ray makes with the line perpendicular to the
interface between the two medium) is less than the critical angle the ray refracts and move closer
to the surface.
If the angle of incidence is equal to the critical angle, the light bends along the interface.
If the angle of incidence is greater than the critical angle, the ray reflects and travels
again in the denser substance. Critical angle differs from one medium to another medium.
Optical fiber use reflection to guide light through a channel.
25
A Glass or plastic core is surrounded by a cladding of less dense glass or plastic.
Propagation Modes
Multimode
In the multiple mode, multiple light beams from a source move through the core in
different paths.
Multimode-Step-Index fiber: The density of core remains constant from the centre to
the edge.
A ray of light moves through this constant density in a straight line until it reaches the
interface of the core and the cladding. At the interface there is an abrupt change to a
lower density that changes the angle of the beam’s motion.
Multimode- Graded -Index fiber: The density is varying. Density is highest at the
centre of the core and decreases gradually to its lowest at the edge.
Single Mode
Single mode uses step-index fiber and a highly focused source of light
that limits beams to a small range of angles, all close to the horizontal.
The single mode fiber itself is manufactured with a much smaller
diameter than that of multimedia fiber.
Connectors
Subscriber channel (SC) connector is used for cable TV.
Straight-tip (ST) connector is used for connecting cable to networking devices.
Unguided media
Unguided media transport electromagnetic waves without using a physical conductor.
This type of communication is often referred to as wireless communication.
Signals are normally broadcast through air and thus available to anyone who has device
capable of receiving them.
Unguided signals can travel from the source to destination in several ways:
Radio Waves
Electromagnetic waves ranging in frequencies between 3 kHz and 1 GHz are normally
called radio waves.
Properties
Radio waves are omnidirectional. When an antenna transmits radio waves, they are
propagated in all directions. This means that the sending and receiving antennas do
not have to be aligned.
A sending antenna sends waves that can be received
by any receiving antenna.
Radio waves, particularly those of low and medium
frequencies, can penetrate walls.
Fig:Omnidirectional
antenna
Disadvantages
The omnidirectional property has a disadvantage, that the radio waves transmitted by
one antenna are susceptible to interference by another antenna that may send signals
using the same frequency or band.
27
As Radio waves can penetrate through walls, we cannot isolate a communication to
just inside or outside a building.
Applications
Radio waves are used for multicast communications, such as radio and television, and
paging systems.
Microwaves
Electromagnetic waves having frequencies between 1 and 300 GHz are called
microwaves.
Properties
Microwaves are unidirectional.
Sending and receiving antennas need to be aligned
Microwave propagation is line-of-sight
Very high-frequency microwaves cannot penetrate walls
Parabolic Dish antenna focus all incoming waves into single point
Outgoing transmissions are broadcast through a horn aimed at the dish.
Disadvantage
If receivers are inside buildings, they cannot receive these waves
Applications
Microwaves are used for unicast communication such as cellular telephones, satellite
networks, and wireless LANs.
Infrared
Electromagnetic waves with frequencies from 300 GHz to 400 THz are called
infrared rays
Infrared waves, having high frequencies, cannot penetrate walls.
Applications
Infrared signals can be used for short-range communication
in a closed area using line-of-sight propagation.
28
10. Discuss in detail the concepts of Packet Switched Networks (Packet Switching)
Introduction
SWITCHING
To make communication among multiple devices efficiently, a process used is called
switching.
A switched network consists of a series of interlinked nodes called switches.
Type of switching
Circuit Switching
Packet Switching
Message Switching
The data rate of circuit switched connections for data transmission is very slow.
Circuit switching is inflexible. Once a circuit has been established, that the path taken by
all parts of the transmission whether or not it remains the most efficient.
Circuit switching treats all transmission as equal. That means, there is no priority among
the transmission of data.
The mostly widely used switching technique for data transmission is packet switching.
In this, the data are transmitted in the form of packets.
If the length of the packet is too long then it is broken-up into multiple packets.
Each packet contains data and also a header with control information.
PACKET SWITCHING:
There are two popular approaches to packet switching:
In the datagram approach, each packet is treated independently from all others.
29
A datagram is a multipacket of the same message and it works on the principle of ‘send’
and ‘forget’.
The features of datagram are as follows:
Circuit setup is not needed.
Each packet contains both source and destination address.
Each packet routed independently.
Few packets are lost during crash.
No effect or router failure.
Example
The below figure shows how the datagram approach can be used to deliver four
packets from station A to station Y.
In this example, all four packets belong to the same message but may go by different
paths to reach their destination.
This approach can cause the datagrams of a transmission to arrive at their destination
out of order.
In most protocols, it is the responsibility of transport layer to reorder the datagrams
before passing them on to the destination.
Routing Table
In this type of network, each switch (or packet switch) has a routing table which is based
on the destination address. The routing tables are dynamic and are updated periodically. The
destination addresses and the corresponding forwarding output ports are recorded in the tables.
This is different from the table of a circuit switched network (discussed later) in which each
entry is created when the setup phase is completed and deleted when the teardown phase is over
30
Virtual Circuit Approach:
In the virtual circuit approach, the relationship between all packets belonging to a
message or session is preserved.
A single route is chosen between sender and receiver at the beginning of the session.
When the data are sent, all packets of the transmission travel one after another along that
route.
Virtual circuit transmission is implemented in two formats:
Switched Virtual Circuit (SVC)
Permanent Virtual Circuit (PVC)
In the switched virtual circuit (SVC) method, a virtual circuit is created whenever it
is needed exits only for the duration of the specific exchange.
If the station A wants to send four packets to station X, first it requests the
establishment of a connection to station X.
Once the connection is established, the packets are sent one after another and in
sequential order. When the last packet has been received, the connection is released
and that virtual circuit ceases to exist.
Only one single route exists for the duration of transmission. Each time that station A
wants to communicate with station X, a new route is established.
Permanent Virtual Circuit (PVC)
In the permanent Virtual Circuit (PVC) method, the same virtual circuit is
provided between two users on a continuous basis.
31
This circuit is dedicated to the specific users. No one else can use it, because it is
always in place.
It can be used without connection establishment and connection termination.
Two SVC users may get a different route every time they request a connection whereas two PVC
users always get the same route.
32
Addressing
In a virtual-circuit network, two types of addressing are involved: global and local (virtual-circuit
identifier).
Global Addressing
A source or a destination needs to have a global address—an address that can be unique in the
scope of the network or internationally if the network is part of an international network.
However, we will see that a global address in virtual-circuit networks is used only to create a
virtual-circuit identifier, as discussed next.
Virtual-Circuit Identifier
The identifier that is actually used for data transfer is called the virtual-circuit identifier (VCI)
or the label. A VCI, unlike a global address, is a small number that has only switch scope; it is
used by a frame between two switches.
Three Phases
As in a circuit-switched network, a source and destination need to go through three phases in a
virtual-circuit network: setup, data transfer, and teardown.
In the setup phase, the source and destination use their global addresses to help switches
make table entries for the connection.
In the teardown phase, the source and destination inform the switches to delete the
corresponding entry.
Data transfer occurs between these two phases.
33
Guaranteed quality of service
Disadvantages
Inefficient-the equipment may be unused for a lot of the call, if no data is being sent, the
dedicated still remains open
Takes a relatively long time to set up the circuit
During a crisis or disaster, the network may become unstable or unavailable.
It was primarily developed for voice traffic rather than data traffic.
Packet Switching:
Advantages
More security
Bandwidth used to full potential
Devices of different speeds can communicate
Not affected by line failure(redirects signal)
Availability-do not have to wait for a direct connection to become available
During a crisis or disaster, when the public telephone network might stop working, e-
mails and texts can still be sent via packet switching
Disadvantages
Under heavy use there can be a delay
Data packets can get lost or become corrupted.
Protocols are needed for a reliable transfer
Not so good for some types data streams.
Example: Real-Time Video streams can lose frames due to the way packets arrive out of
sequence.
34
We have explicitly shown the multiplexing symbols to emphasize the division of the link
into channels even though multiplexing can be implicitly included in the switch fabric.
The end systems, such as computers or telephones, are directly connected to a switch. We
have shown only two end systems for simplicity. When end system A needs to communicate
with end system M, system A needs to request a connection to M that must be accepted by all
switches as well as by M itself. This is called the setup phase; a circuit (channel) is reserved on
each link, and the combination of circuits or channels defines the dedicated path. After the
dedicated path made of connected circuits (channels) is established, the data-transfer phase can
take place. After all data have been transferred, the circuits are torn down.
Three Phases
The actual communication in a circuit-switched network requires three phases: connection setup,
data transfer, and connection teardown.
Setup Phase
Before the two parties (or multiple parties in a conference call) can communicate, a dedicated
circuit (combination of channels in links) needs to be established. The end systems are normally
connected through dedicated lines to the switches, so connection setup means creating dedicated
channels between the switches. For example, in Figure 8.3, when system A needs to connect to
system M, it sends a setup request that includes the address of system M, to switch I. Switch I
finds a channel between itself and switch IV that can be dedicated for this purpose. Switch I then
sends the request to switch IV, which finds a dedicated channel between itself and switch III.
Switch III informs system M of system A’s intention at this time.
35
In the next step to making a connection, an acknowledgment from system M needs to be
sent in the opposite direction to system A. Only after system A receives this acknowledgment is
the connection established.
Data-Transfer Phase
After the establishment of the dedicated circuit (channels), the two parties can transfer data.
Teardown Phase
When one of the parties needs to disconnect, a signal is sent to each switch to release the
resources.
16 MARKS
1. Discuss the issues in the data link layer (16) (Q.NO 9)
2. Explain in detail the error detecting codes (16) (Q.NO 10)
16 MARKS
1. Discuss in detail about Internet Architecture (16) (Q.NO 6)
2. What is the need for error detection? Explain with typical examples. Explain methods used
for error detection and error correction (16) (Q.NO 10 & 13)
2 MARKS
1. State the issues of data link layer (Q.NO 37)
2. Define the term protocol (Q.NO 45)
16 MARKS
1. Draw the OSI network architecture and explain the functionalities of every layer in detail (16)
(Q.NO 5)
2. Explain the various flow control mechanisms (16) (Q.NO 11)
36
16 MARKS
1. Explain any two error detection mechanism in detail (16) (Q.NO 10)
2. Explain in detail about HDLC & PPP (8+8) (Q.NO 9)
2 MARKS
1. List the services provided by data link layer (Q.NO 37)
2. Write the mechanism of stop and wait flow control (Q.NO 46)
16 MARKS
1. Draw the OSI network architecture and explain the functionalities of every layer in detail (16)
(Q.NO 5)
2. a)Discuss in detail about the network performance measures (8) (Q.NO 8)
b) Explain selective-repeat ARQ flow control method.(8) (Q.NO 11)
PART B
1. i) Explain the challenges faced in building a network (10) (Q.NO 4)
ii) Obtain the 4-bit CRC code for the data bit sequence 10011011100 using the polynomial
x4+x2+1 (3) (Q.NO 14)
2.i) With a protocol graph explain the architecture of internet (7) (Q.NO 6)
ii) Consider a bus LAN with a number of equally spaced stations with a data rate of 9 Mbps
and a bus length of 1 km. What is the mean time to send a frame of 500 bits to another station,
measured from the beginning of transmission to the end of reception? Assume a propagation
speed of 150 m/s. If two stations begin to monitor and transmit the same time, how long does it
need to wait before interference is noticed? (6) (Q.NO 15)
PART A
1. Define the terms: Bandwidth & Latency (Q.NO 52)
2. Compare Byte oriented versus Bit-oriented protocol (Q.NO 53)
PART B
1. With a neat sketch, explain the architecture of an OSI seven layer model (13) (Q.NO 5)
2. Discuss the approaches used for error detection in networking (13) (Q.NO 10)
PART C
1. Outline the steps involved in building a computer network. Give the detailed description for
each step (15) (Q.NO 4)
37