Professional Documents
Culture Documents
Important Portions m3 m4 m5
Important Portions m3 m4 m5
EXAM
MODULE 3, MODULE 4 and MODULE 5
MODULE 3
1) Distance Vector Algorithm
1. A router transmits its distance vector to each of its neighbours in a
routing packet.
2. Each router receives and saves the most recently received
distance vector from each of its neighbours.
3. A router recalculates its distance vector when:
It receives a distance vector from a neighbour containing
different information than before.
It discovers that a link to a neighbour has gone down.
The DV calculation is based on minimizing the cost to each
destination
In distance vector routing, each node shares its routing
table with its immediate neighbors periodically.
Initialization
Each node can know only the distance between itself and its immediate
neighbors, those directly connected to it.
each node can send a message to the immediate neighbors and find the
distance between itself and these neighbors.
When a node receives a two-column table from a neighbor, it needs to
update its routing table. Updating takes three steps:
1.The receiving node needs to add the cost between itself and the
sending node to each value in the second column.
2.The receiving node needs to add the name of the sending node to
each row as the third column if the receiving node uses information
from any row.The sending node is the next node in the route.
Updating
3.The receiving node needs to compare each row of its old table with
the corresponding row of the modified version of the received table.
a) If the next-node entry is different, the receiving node chooses the row
with the smaller cost. If there is a tie, the old one is kept.
b) If the next-node entry is the same, the receiving node chooses the new
row.
18
Form a new virtual circuit that omit congested routers and
all their lines.
Negotiate an agreement between host and subnet while
forming a virtual circuit and reserve all required resources to
prevent congestion in future.
(a) A congested subnet. (b) A redrawn subnet, eliminates congestion and a virtual circuit from A to B.
Congestion control in Datagram
subnets
1.The Warning Bit
• The warning state is set as a special bit in the packet’s header.
• As long as the router was in the warning state, it continued to set
the warning bit, which meant that the source continued to get
acknowledgements with it set.
2.Choke Packets
• The router sends a choke packet back to the source host.
• When the source host gets the choke packet. It reduce the
traffic by x%. It ignore choke packets referring to the
destination for a fixed time interval, and check again if there
is still the choke packets sent back.
20
3.Hop-by-Hop Choke Packets
•A choke packet that affects each hop it
passes through. More buffer request for
router F at this moment.
4.Load shedding
23
(a) High jitter. (b) Low jitter.
6) Techniques for Achieving Good Quality of Service
Overprovisioning
• An easy solution is to provide so much router capacity, buffer space, and bandwidth that
the packets just fly through easily.
• The trouble with this solution is that it is expensive.
Buffering
Flows can be buffered on the receiving side before being delivered.
Buffering them does not affect the reliability or bandwidth, and increases the
delay, but it smooths out the jitter.
Traffic Shaping
Traffic shaping is about regulating the average rate (and burstiness) of data
transmission.
Monitoring a traffic flow is called traffic policing.
24
Techniques for Achieving Good Quality of Service
leaky bucket algorithm
• A leaky bucket algorithm shapes bursty traffic into fixed-rate traffic by averaging
the data rate.
• It may drop the packets if the bucket is full.
• In this algorithm, the leaky bucket holds tokens, generated by a clock at the rate of one token
every T sec.
25• For a packet to be transmitted, it must capture and destroy one token.
Packet Scheduling
• Packets from different flows arrive at a switch or
router for processing.
• A good scheduling technique treats the different
flows in a fair and appropriate manner.
• Several scheduling techniques are designed to
improve the quality of service.
• Three of them here:
1. FIFO queuing,
2. priority queuing,
3. and weighted fair queuing.
26
MODULE 4
1) IPV4 protocol
The IP Protocol
Version field
Version is a 4 bit field that indicates the IP version used.
IHL field
Header length is a 4 bit field that contains the length of the IP header.
The initial 5 rows of the IP header are always used.
So, minimum length of IP header = 5 x 4 bytes = 20 bytes.
The size of the 6th row representing the Options field vary from 0-40 bytes.
So, maximum length of IP header = 20 bytes + 40 bytes = 60 bytes.
Type of service field.
to distinguish between different classes of service
6-bit field contained a three-bit Precedence field and three flags, D, T,
and R. {Delay,Throughput, Reliability}
The IP Protocol
Total length field
Total length is a 16 bit field that contains the total length of the datagram (in bytes).
Total length = Header length + Payload length
Identification field
Identification is a 16 bit field.
use to identify fragments of the same frame, Useful in re assembly of fragmented
datagrams.
DF stands for Don’t Fragment. It is an order to the routers not to fragment the packet.
if we don’t want the packet to be fragmented then DF is set i.e. DF = 1.
MF stands for More Fragments. All fragments except the last one have this bit set.
if MF = 1, more fragments are ahead of this fragment and if MF = 0, it is the last fragment.
Fragment offset
use to identify the sequence of fragments in the frame. It generally indicates a number of
data bytes preceding or ahead of the fragment.
TheTtL (Time to live)
It indicates the maximum number of hops a datagram can take to reach
the destination.
It prevent the IP datagrams from looping around forever in a routing
loop.
Protocol field
It tells the network layer at the destination host to which protocol the IP
datagram belongs to.
Protocol number of ICMP is 1, IGMP is 2, TCP is 6 and UDP is 17.
Header Checksum
It contains the checksum value of the entire header.
The checksum value is used for error checking of the header.
The IP Protocol
Source address and Destination address
indicate the network number and host number.
logical address of the sender and receiver of the datagram.
Options field
options is a field whose size vary from 0 bytes to 40 bytes.
This field is used for several purposes such as-
Record route
Source routing
Padding
ARP / RARP / ICMP / BOOTP / DHCP /BGP /
Internet multicasting
RIP/OSPF
IPv6
Next header field
there can be additional (optional) extension headers.
This field tells which of the (currently) six extension headers follow this
one.
If this header is the last IP header, the Next header field tells which
transport protocol handler (e.g.,TCP, UDP) to pass the packet to.
Hop limit field
used to keep packets from living forever.
same as the Time to live field in IPv4, namely, a field that is
decremented on each hop.
Source address and Destination address fields
16-byte addresses written as eight groups of four hexadecimal digits
with colons between the groups
8000:0000:0000:0000:0123:4567:89AB:CDEF
IPV4 and IPV6
MODULE 5
1) Transmission control protocol (TCP)
TCP provides a connection oriented, reliable, byte stream service.
It is a full duplex protocol,
TCP includes a flow-control mechanism
TCP also implements a congestion-control mechanism.
• Two processes communicating via TCP sockets.
• Each side of a TCP connection has a socket which can be identified
by the pair < IP_address, port_number >.
• Two processes communicating over TCP form a logical connection
that is uniquely identifiable by the two sockets involved, that is by
the combination < local_IP_address, local_port, remote_IP_address,
remote_port>
TCP Header
1. Source port number (16 bits)
identifies the TCP process which sent the datagram.
2. Destination port number (16 bits)
identifies the TCP process which is receiving the datagram.
3. Sequence number (32 bits)
identifies the first byte of the outgoing data.
4. Acknowledgement number (32 bits) :Contains the next sequence number that the
sender of the acknowledgement expects to receive, which is the sequence number plus 1
5. Header Length
The length of the header can be between 20 and 60 bytes.
6. Reserved – This is a 6-bit field reserved for future use
13.Window Size(16 bit)
identifies how much buffer space is available for incoming data.
14.Checksum(16 bit)
field contains a simple checksum over the TCP segment header and data.
15.Urgent Pointer (16 bit)
valid only if the urgent flag is set, is used when the segment contains urgent data.
16.Options
There can be up to 40 bytes of optional information in theTCP header.
17.Data
This can be of variable size.
which can be up to 65535 – 20 = 65515 bytes.
TCP Connection establishment &release
In TCP connection-oriented transmission requires two phases:
• Connection establishment and Data transfer
• Connection termination
The three steps in this phase are as follows:
1. The client sends the first segment, a SYN segment, in which only the SYN flag is set.
2. The server sends the second segment, a SYN + ACK segment, with 2 flag bits set: SYN and
ACK.
3.The client sends the third segment.
This is just an ACK segment.
It acknowledges the receipt of the second segment with the ACK flag and
acknowledgment number field.
Connection establishment using three-way handshaking
24.4
DataTransfer
•After connection is established, bidirectional data transfer can take place.
•The client and server can both send data and acknowledgements.
Connection Release/Termination
•The initiator sends a FIN with the current sequence and
acknowledgement number.
• The responder on receiving this informs the application program
that it will receive no more data and
sends an acknowledgement of the packet.
•The connection is now closed from one side.
• Now the responder will follow similar steps to close the connection
from its side.
•Once this is done the connection will be fully closed.
Data transfer
24.4
Connection termination using three-way handshaking
24.4
2) UDP Frame Format - UDP length = IP length – IP Header’s length
Header Source port:
• UDP port of sending host.
• The sending port value is optional. If not used,
it is set to zero.
• Needed to send reply to source
Destination port:
• UDP port of destination host.
• This provides an endpoint for communications.
Length:
• the size of the UDP message. The minimum
UDP packet contains only the header
information (8 bytes).
Checksum:
• verifies that the header is not corrupted.
• The checksum value is optional, If not used, it
is set to zero.
• If an error is detected, the entire UDP segment
TCP UDP
3) File Transfer Protocol (FTP) - Connections
FTP is an application layer protocol which moves files between local
and remote file systems or copying a file from one computer to
another.
It runs on the top of TCP.
FTP : Data connection
For sending the actual file, FTP makes use of data connection.
A data connection is initiated on port number 20.
26.56
FTP – File Transfer
To transfer files through the data connection,The client must define
the type of file to be transferred,
the structure of the data, and
the transmission mode.
FTP can transfer one of the following file types across the data connection:
an ASCII file
EBCDIC file or image file
FTP : Data Structures
FTP allows three types of data structures :
File Structure
In file-structure there is no internal structure and
the file is considered to be a continuous sequence or stream of data bytes.
Record Structure
In record-structure the file is divided into records.
This can be used only with text files.
the file is made up of sequential records.
Page Structure
the file is divided into pages, with each page having a page number and a page header
In page-structure the file is made up of independent indexed pages.
The pages can be stored and accessed randomly or sequentially.
FTP : Transmission modes
FTP can transfer a file across the data connection by using one of the
following three transmission modes:
stream mode
Data are delivered from FTP to TCP as a continuous stream of bytes.
Block mode
Data can be delivered from FTP to TCP in blocks.
6. The client issues a passive open on an ephemeral port for the data connection
and sends the PORT command (over the control connection) to give this port
number to the server.
7. The server does not open the connection at this time,
but it prepares itself for issuing an active open on the data connection
between port 20 (server side) and the ephemeral port received from the
client.
It sends response 150 (data connection will open shortly).
9. Now the server responds with 125 and opens the data connection.
10. The server then sends the list of the files or directories (as a file) on the data
connection.
When the whole list (file) is sent, the server responds with 226 (closing data
connection) over the control connection.
11. The client now has two choices.
It can use the QUIT command to request the closing of the control connection
or it can send another command to start another activity (and eventually open
another data connection). In our example, the client sends a QUIT command.
12.After receiving the QUIT command, the server Responds with 221 (service
closing) and then closes the control connection.
61
Domain Name System (DNS)
Each internet host is assigned a host name and IP address
Host name are structured character strings eg.www.google.com.
IP addresses are 32- bit integers eg. 139.130.4.5.
DNS is the naming service of the internet that resolve host names to IP
addresses.
DNS allows users of internet application to refer to remote hosts by name
rather than by address.
The Domain Name System (DNS) translates Internet domain and host names
to IP addresses and vice versa.
The names assigned to machines must be unique because the addresses are unique.
A name space that maps each address to a unique name can be organized in two ways:
Flat Name Space
Hierarchical Name Space
Domain Name Space
The domain name space is hierarchical in
design.
The names are defined in an inverted-tree
structure with the root at the top.
The tree can have 128 levels: level 0 (root)
to level 127.
Conceptually, the Internet is divided into
over 200 top-level domains, where each
domain covers many hosts.
Each domain is partitioned into
subdomains, and these are further
partitioned, and so on.
All these domains can be represented by a
tree,
The leaves of the tree represent domains
that have no subdomains.
Fully Qualified Domain Name (or • Here the resolver can supply the
absolute domain name): missing part, called the suffix, to
• If a label is terminated by a null create an FQDN.
string, it is called a fully qualified •
domain name (FQDN).
• An FQDN is a domain name that
contains the full name of a host.
• It contains all labels,
Partially Qualified Domain Name
(or relative domain name):
• If a label is not terminated by a null
string, it is called a partially
qualified domain name (PQDN).
• A PQDN starts from a node, but it
does not reach the root.
Name Servers
DNS servers called a zone file and keeps all the
Divide the whole space into information for every node under
many domains based on the first that domain.
level. The information about the nodes
let the root stand alone and create in the subdomains is stored in
as many domains (subtrees) as the servers at the lower levels.
there are first-level nodes.
DNS allows domains to be
divided further into smaller
domains (subdomains).
Zone : It can be defined as a
contiguous part of the entire
tree.
The server makes a database
Root Server
A root server is a server whose zone consists of the whole tree.
DNS defines two types of servers:
primary - server that stores a file about the zone for which it is an
authority.
Secondary - server that transfers the complete information about a
zone from another server (primary or secondary) and stores the file on
its local disk
DNS – TYPES OF DOMAINS
In the Internet, the domain name space (tree) is divided into three
different sections:
generic domains - define registered hosts according to their
generic behaviour
country domains - two-character country abbreviations (e.g., us for
United States).
inverse domain - used to map an address to a name.
Resource Records
Every domain can have a set of resource records associated with it.
the primary function of DNS is to map domain names onto resource records.
A resource record is a five-tuple
-The third field of every resource record is the Class. For Internet information, it is
always IN.
- Value field. This field can be a number, a domain name, or an ASCII string.
Figure1. The principal DNS resource record types for IPv4.
-SOA record provides the name of the primary source of information about the name
server's zone (described below), the e-mail address of its administrator, a unique serial
number, and various flags and timeouts.
- A (Address) record holds a 32-bit IP address for some host. Every Internet host must
have at least one IP address so that other machines can communicate with it.
Composing Messages
A user agent helps the user compose the e-mail message to be sent out.
Most user agents provide a template on the screen to be filled in by the user.
Reading Messages
The second duty of the user agent is to read the incoming messages.
When a user invokes a user agent, it first checks the mail in the incoming mailbox.
Most user agents show a one-line summary of each received mail.
Replying to Messages
After reading a message, a user can use the user agent to reply to a message.
A user agent usually allows the user to reply to the original sender or to
reply to all recipients of the message.
The reply message may contain the original message and the new message.
Forwarding Messages
Replying is defined as sending a message to the sender or recipients of the
copy.
Forwarding is defined as sending the message to a third party.
Handling Mailbox
The protocol that defines the MTA client and server in the Internet is called
Simple MailTransfer Protocol (SMTP).
IMAP and POP being two other important protocols for retrieving mail messages.
MIME -Multipurpose Internet Mail
Extensions – Need and Importance
MIME is an extension of the original Email
protocol SMTP. SMTP is a protocol used to send and receive
Emails.
Limitations of SMTP
SMTP can only send ASCII test (plain text characters)
SMTP can’t transmit video/audio/graphic/executable files
SMTP servers may reject messages bigger than certain size
SMTP can’t transmit various national language characters other
than English
MIME -Multipurpose Internet Mail
Extensions – Need and Importance
MIME is intended to solve these problems. MIME was defined in 1992 by the
Internet Engineering Task Force (IETF).
MIME standard helps extend the limited capabilities of email by allowing insertion
of images, sounds, video and animations in a message.
Features offered by MIME
– SNMP manager