0% found this document useful (0 votes)
16 views144 pages

Maharevision Part-3

The document covers various networking concepts including IP addressing, error control, flow control, and TCP/UDP protocols. It details error detection and correction methods, including Hamming codes and CRC, as well as TCP's connection-oriented features and congestion control mechanisms. Additionally, it includes questions related to these topics for assessment purposes.

Uploaded by

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

Maharevision Part-3

The document covers various networking concepts including IP addressing, error control, flow control, and TCP/UDP protocols. It details error detection and correction methods, including Hamming codes and CRC, as well as TCP's connection-oriented features and congestion control mechanisms. Additionally, it includes questions related to these topics for assessment purposes.

Uploaded by

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

to be covered

1 IP Addressing, Subnetting & Supernetting

2 Error control

3 Flow control

4 IPv4 header and fragmentation


to be covered
1 IP Addressing, Subnetting & Supernetting

2 Error control

3 Flow control

4 IPv4 header and fragmentation


to be covered
Error Control

TCP &UDP

Routing Algorithms

Application layer protocol

OSI And TCP/IP Protocol Stack


ERROR CONTROL
Error Control

Types of Errors

Single - Bit Error Burst Error

0 1 0 0 1 0 1 0
Sent 0 0 0 0 0 0 1 0 Sent

Corrupted bit
0 1 1 0 1 1 1 0
Received
Received 0 0 0 0 1 0 1 0
Error Control

Error Detection Error Correction

1. Once noticed error simply discard. Capability of correcting error.

2. Ask for retransmission. Does not required retransmission.


Error Control

Error Control

Error Detection Error Correction

1. Simple Parity 1. Hamming code


2. 2D parity
3. Check sum
4. CRC
Hamming distance

Hamming distance between two Binary string of same size is the number of
differences between corresponding bits.
Hamming distance between two Binary string is denoted by d(x, y)
d(000, 011) = 2
d(100, 011)=3
d(10101, 11110)=3
Hamming distance can easily be found if we apply XOR operation (⊕) on the two
words and count the Number of 1’s in the result.
Minimum Hamming distance

In a set of codewords, the minimum Hamming distance is the smallest Hamming


distance between all possible pairs of code words.

Valid code word d a, b =3


0 1 0 (a) 𝑑 𝑎, 𝑐 =1
𝑑 𝑎, 𝑑 =2
1 0 1 (b) Minimum Hamming distance = 1
𝑑 𝑏, 𝑐 =2
1 1 0 (c) 𝑑 𝑏, 𝑑 =1
0 0 1 (d) 𝑑 𝑐, 𝑑 =3
Minimum Hamming distance for Error detection

To detect ‘d’ bit error minimum hamming distance required =d+1


Minimum Hamming distance for Error correction

To Correct ‘d’ bit error minimum hamming distance required =2d+1


QUESTION

#Q. Consider a binary code that consists of only four valid code words as given
below:
00000, 01011, 10101, 11110
Let the minimum Hamming distance of the code be p and the maximum number
of erroneous bits that can be corrected by the code be q. Then the values of p and
q are
GATE 2017
A p = 3 and q = 1

B p = 3 and q = 2

C p = 4 and q = 1

D p = 4 and q = 2
QUESTION

Assume a binary code that contains only 5 valid code words as given
0000000, 1010110, 0101111, 0101010, 1101001 and assume minimum
hamming distance of a code be x and maximum number of erroneous bits
that can be deleted by the code is y and corrected by code be z, then the
value of x + y + z is_____.
QUESTION

#Q. The minimum Hamming distance to correct upto 5 bit error successfully is ______
Q. An error control code with minimum hamming distance of 11 is
capable of
[MSQ]
A. Detecting 11 bits of error

B. Detecting 5 bits of error


C. Correcting 5 bits of error

D. Correcting 11 bits of error


Simple Parity Check Code

q In the Simple parity concept one extra bit ( parity bit ) is added to each dataword.
q Simple parity check can detect all single bit error.
q Simple parity check can not detect an even number of errors.
q Simple parity check can detect an odd number of errors .
2D Parity Check Code

q Two-dimensional parity check can detect and correct all single bit error and detect
two- or three-bit error that occur anywhere in the matrix.
q However only some pattern with four or more Errors can be detected.
q In a 2D-parity check code, the information bits are organized in a matrix consisting
of rows and columns.
q For each row and each column one parity check bits is calculated
Introduction to CRC :
Ø Length of the dataword=n
Ø Length of the divisor=k
Ø Append (k-1) Zero’s to the original message
Ø Perform modulo 2 division
Ø Remainder of division = CRC
Ø Code word =(n+k-1)bits
Note: CRC must be (k-1) bits
Ø Codeword = dataword with appended (k-1) Zeros+ CRC
Polynomial Notation in CRC

Ø Data word=d(x)
Ø Codeword=c(x)
Ø Generator=g(x)
Ø Syndrome=s(x)
Ø Error=e(x)
Polynomial Notation in CRC
How to apply the CRC step by step :
1. Determine the degree ‘r’ of g(x) (highest power)
2. Determine xrd(x)
3. Determine the remainder by dividing xrd(x) by g(x)
4. Codeword= xrd(x)+remainder
QUESTION

#Q. The message 11001001 is to be transmitted using the CRC polynomial x3 + 1 to


protect it from errors. The message that should be transmitted is

A 11001001000

B 11001001011

C 11001010

D 110010010011
A d(x) is x7 + x5 + x4 + x2 + 1 transmitted using CRC polynomial
Q.
method. The g(x) is x3 + 1. What is the polynomial of CRC
remainder? [MCQ]
A. x + x0

B. x0

C. x2 + x0

D. x2 + x + x0
NOTE

1. CRC must be (k-1) bits.


2. If the generator has more than one term and coefficient of x0 is 1, all single bit error
can be detected.
3. If a generator can’t divide xt + 1 (t between 0 and n – 1) then all isolated Double
error can be detected.
4. The generator that contains a Factor of x + 1 can detect all odd numbered errors.
A good polynomial generator needs to
have the following characteristics

1. It should have at least two terms.


2. The coefficient of the term x0 should be 1.
3. It should not divide xt + 1, for t between 2 and n – 1.
4. It should have the factor x + 1.
Hamming Code

1. Hamming code is used for error correction.


2. Hamming code can correct 1 bit error only.
3. Hamming code can detect upto 2 bit error.
m = Message bits
r = redundant bits or Check bits or parity bits or extra bits
n = m + r (n = codeword)
According to the hamming code, number of redundant bits
m + r + 1 £ 2r
where r = lower limit
Q. After encoding using Hamming method, the pattern for 1010111 is
(consider Even Parity)
A. 10110101111

B. 10111101111
C. 11110101111

D. 10011101111
QUESTION

#Q. Consider hamming code (Signal bit error detection and correction technique),
the minimum parity bits needed for 60 data bits is _____ .
QUESTION

#Q. For single bit error correcting hamming code ,the code length for 12 data bit is
_______
TCP & UDP
Introduction

Transport Layer can be connection oriented or connection less.

Transport Layer

TCP UDP
Transmission Control User Datagram
Protocol Protocol
Introduction

1. TCP is reliable process to process delivery of entire message.


2. TCP is connection oriented.
3. TCP connection are full duplex and point to point.
4. TCP connection has 3 phases:
i. Connection establishment
ii. Data transfer
iii. Connection termination
Introduction

5. Each TCP connection is identified uniquely by Source Port + Destination Port +


Source IP + Destination IP.
6. Each TCP connection is associated with Four window.
7. TCP uses three way “Handshake” to establish TCP connection.
8. TCP is not useful for Broadcasting and Multicasting.
9. TCP Header size is 20 bytes but if option (40 bytes) is added it will become 60
bytes.
10. TCP provide end to end error control and flow control.

11. Data may arrive out of order and be temporarily stored by receiving TCP, but
TCP guarantee that no out of order data delivered to the process.
TCP header

Source Port (16 bits) Destination Port (16 bits )

Sequence number (32 bits)

Acknowledgement number (32 bits)

U A P R S F Window Size
Header Length Reserved bits
R C S S Y I (Advertisement
(4 bits) (6 bits)
B K H T N N Window) (16 bits)

Urgent Pointer (16


Check sum (16 bits)
bits)
Options
(0 - 40 bytes)
TCP header

Port Number Name

0 – 1023 Well known Port No.

1024 – 49151 Registered Port No.

49152 – 65535 Dynamic Port No.

Total Sequence Number


Wrap Around Time WAT =
Bandwidth [Bytes/Sec]
TCP header
• Minimum sequence number required to Avoid wrap around time with in Life time = B ×
LT
• Minimum number of bits required to Avoid wrap Around time with in LT =⌈log2 B *
LT⌉
QUESTION

Consider a long-lived TCP session with an end-to-end bandwidth of 1 Gbps (= 109 bits
per second). The session starts with a sequence number of 1234. The minimum time
(in seconds, rounded to the closest integer) before this sequence number can be used
again is _______ .
QUESTION

Consider the data transfer using TCP over a 1 Gbps link. Assuming that the maximum
segment lifetime (MSL) is set to 60 seconds, the minimum number of bits required for
the sequence number field of the TCP header, to prevent the sequence number space
from wrapping around during the MSL is ______.
SYN = 1 → Consume one sequence number.
Ack = 1 → Consume zero sequence number.
FIN = 1 → Consume one sequence number.
1 Data byte → Consume one sequence number.

SYN Ack Meaning

1 0 request

1 1 reply
0 1 Ack/data
0 0 Data
Congestion Control

Ws = min (Wc, WR)

Slow start Congestion Avoidance Congestion Detection

1. If ACK Arrives 1. IF ACK Arrives


1. Time out
Wc = Wc + 1 Wc = Wc + 1/Wc

2. After one RTT 2. After one RTT


2. 3 duplicate ACK
Wc = 2 * Wc Wc = Wc + 1
QUESTION

Consider the following statements regarding the congestion avoidance phase of


the TCP congestion control algorithm. Note that cwnd stand for the TCP congestion
window and MSS denotes the Maximum Segment Size.
i. The cwnd increases by 1 MSS on every successful acknowledgment.
ii. If an ACK arrive the size of the cwnd increases only 1/cwnd portion of MSS
iii. The cwnd increases by 1 MSS every round trip time.
iv. The cwnd approximately doubles every round trip time
Which one of the following is correct?

A Only (ii) and (iii) are true B Only (iv) is true

C Only (i) and (iii) are true D Only (i) and (iv) are true
QUESTION

Let the size of congestion window of TCP connection be 64kb when a time out
occurs. The round trip time of connection is 100 milliseconds and the maximum
segment size used is 4kb. The time taken (in milliseconds) by the TCP connection to
get back to 64kb congestion window is

A 1100 to 1300 B 800 to 1000

C 1400 to 1600 D 1500 to 1700


QUESTION

Consider a TCP client and a TCP server running on two different machines. After completing data
transfer, the TCP client calls close to terminate the connection and a FIN segment is sent to the
TCP server. Server-side TCP responds by sending an ACK. Which is received by the client-side TCP.
As per the TCP connection state diagram (RFC 793). In which state does the client-side TCP
connection wait for the FIN from the server-side TCP?
[GATE-2017-CN: 1M]
A LAST-ACK B TIME-WAIT

C FIN-WAIT-1 D FIN-WAIT-2
QUESTION

Consider a TCP server is in close wait state in TCP state transition diagram , which state TCP server
moves after sending FIN segment to TCP client ?

A LAST-ACK

B TIME-WAIT

C FIN-WAIT-1

D FIN-WAIT-2
TCP header

Time out timer in TCP

Basic Algorithm Jacobson’s Algorithm

Time Out Timer = 4 * ID + RTT


Next Round Trip Time (NRTT)
Time Out Timer = 2 * RTT = α (IRTT) + (1 – α) ARTT
Next Round Trip Time (NRTT)
= α(IRTT) + (1 – α)ARTT 0≤α≤1

0≤α≤1 Actual Deviation (AD) = |IRTT – ARTT|

Next Deviation (ND) =α (ID) + (1 – α) AD


Token Bucket

• Token bucket algorithm allows ideal hosts to accumulate credit for the future in the form of tokens.
• In regular interval, tokens are thrown into the bucket.
• Bucket has a maximum capacity.
• If there is a ready packet a token is removed from bucket and packet is sent.
• If there is no token in the bucket, the packet cannot be sent.
Token Bucket

Let the capacity of token bucket is ‘C’ token and token enter into the bucket at rate of ‘r’ tokens per second.
The maximum number of packet that can be enter into the network during the time interval ‘t’ is

Maximum number of packet = C + rt


!"#$
Maximum average rate for token bucket M = C ® token bucket capacity
$
r ® token arrival rate
Mt = C + rt Þ Mt - rt = C Þ (M - r)t = C
!
T=
%&#
QUESTION

A computer on a 10 Mbps network is regulated by a token bucket. The token bucket is filled at a
rate of 2 Mbps. It is initially filled to capacity with 16 Megabits. What is the maximum duration for
which the computer can transmit at the full 10 Mbps? GATE CS 2008
A 1.6 seconds

B 2 seconds

C 5 seconds

D 8 seconds
UDP

1. UDP is message oriented connection less Datagram protocol.


2. It is unreliable Transport protocol.
3. It does not provide Flow control and Error control & congestion control.
4. It does not add anything to the services except process to process delivery of data.
5. Header is simple and fixed in size i.e. 8 byte.

UDP Header
Source port Destination port
(16 bit) (16 bit)

Length Checksum
(16 bit) (16 bit)
NOTE

Unlike TCP, the checksum calculation is not mandatory in UDP. No error control or flow
control is provided by UDP.
Hence UDP depends on IP and ICMP for error reporting.
Optional inclusion of checksum

The sender of UDP packet can choose not to calculate the checksum. In this case the
checksum field is filled with all 0's before being sent.
TCP Vs UDP

TCP UDP
Connection-oriented Connectionless

Reliability in delivery of message Not reliable

Sequence Number. No sequence number.


ACK number. No ACK number.
Overhead is high Overhead is less
(Header size 20-60 Bytes) (Header size = 8 Bytes)

Keep track of order (sequence) No order

Protocol: DNS, SNMP, TFTP, DHCP, All


Protocols: HTTP, FTP, SMTP, POP,IMAP
real time protocol
QUESTION

The following is the content of a UDP header in hexadecimal format.


CB84000D001C001C
A What is the source port number ?

B What is the destination port number ?

C What is the total length of the user datagram ?


D What is the length of the data ?

E Is the packet directed from a client to a server or vice


versa ?
NOTE:-

1. When destination port number is well known port number then data is moving from client to server.
2. When Source port number is well known port number then data is moving from server to client
Routing Algorithms
Routing Algorithm
Routing Algorithm

Flooding : Flooding is simple computer network Routing Algorithm in which every


incoming packet is sent through every outgoing link except one it arrived on.
Advantage of Flooding
1. No Routing is required
2. Shortest path is always guarantee i.e. the packet arrives at the destination first
3. It is highly Reliable , if one path is down then the packet reach at the destination by choosing
another path.

Disadvantage of Flooding
1. Traffic is very high
2. Many duplicate packets received by receiver
Advantage of Routing
1. Traffic is very Less
2. No duplicate packet Received by Receiver

Disadvantage of Routing
1. Routing table is required
2. Chosen path may be down so it is not highly Reliable
3. Shortest path is depends on the algorithm and some algorithms fails to find the shortest path.
Routing Algorithm

Routing algorithm

Static Dynamic

Distance Vector Link state


Routing Routing
Distance vector Routing : (1980)
Step 1: Prepare the Routing table at every Router Based on the local knowledge
Dest. Dis. NH
Dest. Dis. NH

Dest. Dis. NH Dest. Dis. NH


Step 2:

At A
A Receive Distance vector from B, D

At B
B Receive Distance vector from A,C,D

At C
C Rev Distance vector from B,D

At D
D Rev distance from A,B,C
At C: New Routing table At D: New Routing table
QUESTION

Consider the following subnet. If distance vector routing is used, how many link can
never by used after all the routing table. Are stabilized ?
QUESTION

Consider the network of Figure. Distance vector routing is used, and the following
vectors have just come in to router C: from B: (5, 0, 8, 12, 6, 2); from D: (16, 12,
6, 0, 9, 10); and from E: (7, 6, 3, 9, 0, 4). The cost of the links from C to B, D, and E,
are 6, 3, and 5, respectively. What is C’s new routing table? Give both the outgoing
line to use and the cost
Routing Algorithm

Distance vector Routing Link state Routing


1. 1980’s 1. 1990’s
2. Bandwidth required is very less because we 2. Band width required is high because we sent
sent only distance vector packet. entire link state packet
3. Local knowledge 3. Global knowledge
4. Bellman Ford algorithm 4. Dijkstra algorithm
5. Traffic is very less 5. Traffic is very high
6. Convergence is very low 6. Convergence is faster
7. Count to infinity Problem 7. No problem of count to infinity
8. Persistent Loops 8. Transient Loops
9. RIP 9. OSPF
Routing Algorithm

The maximum Hop count allowed For RIP is 15 and Hop count of 16 is considered as
Destination unreachable.

NOTE

RIP uses UDP as its transport protocol with the port number – 530
QUESTION

Which of the following is true about routing information protocol (RIP) and open
shortest path (OSPF)
[GATE 2014]
A RIP uses distance vector routing and OSPF uses link state routing

B OSPF uses distance vector routing and RIP uses link state routing
C Both RIP and OSPF uses link state routing

D Both RIP and OSPF uses distance vector routing


QUESTION

Consider the following statement about routing information protocol (RIP) and open
shortest path (OSPF) in an IPv4 network
1. RIP uses distance vector routing
2. RIP Packet are sent using UDP
3. OSPF packet are sent using TCP
4. OSPF operation is based on link state routing
Which of the statement above are correct
[GATE 2017
A 1 and 4 only B 1 ,2 and 3 only

C 1,2 and 4 only D 2,3 and 4 only


QUESTION

Two popular routing algorithms are Distance Vector(DV) and Link State(LS) routing.
Which of the following are true ?
(S1): Count to infinity is the problem only with DV and not LS routing
(S2): In LS, the shortest path algorithm is run only at one node
(S3): In DV, the shortest path algorithm is run only at one node
(S4): DV requires lesser number of networks messages than LS
[GATE 2008]
A S1 , S2 and S4 only

B S1 , S3 and S4 only
C S2 and S3 only
D S1 and S4 only
IP Support Protocol

ARP
1. Address Resolution Protocol(ARP) is used to find the MAC(Media Access Control) address of a
device from its IP address.
2. ARP request: ARP request is broadcasting
3. ARP response/reply: ARP reply is unicasting.
IP Support Protocol

Internet Control Message Protocol (ICMP)

Feedback Messages or Error Reporting

Destination Source Time Parameter Redirection


unreachable Quench Exceeded Problems
IP Support Protocol

Internet Control Message Protocol (ICMP)

Query or Request and reply

Timestamp
Echo Request Address-Mask Router solicitation
Request &
& Reply Request and
Reply
and reply advertisement
APPLICATION LAYER PROTOCOL
Domain Name System
(DNS)
1. Easy to remember the domain names
2. IP addresses are not static
3. DNS is a protocol used to convert domain name to IP addresses
Domain Name System (DNS)
Most commonly used domain are :
(i) com — usually used by commercial organization eg: Yahoo(yahoo.com)
(ii) edu — usually used by educational institute eg: iisc.edu
(iii) org — used by Non profit organization eg: ieee.org
(iv) mil — used by Military organization
(v) net — It is open public for any commercial organization
(vi) gov — used to represent government organization eg: isro.gov
Iterative Queries

Root DNS
server

Top Level
DNS server
Host Local DNS
server
Authoritative
DNS server
Recursive Queries

Root DNS
server

Top Level
DNS server
Host Local DNS
server
Authoritative
DNS server
Root DNS Server

Root name servers play a key role in resolving any DNS query. There are 13 root name servers
worldwide. If a situation arises that the entire 13 root name servers are unreachable, the Internet would
fail. Usually a host sends a query to its nearest root name server. If any one of these servers fails the
requests are diverted to another nearest server.
E.g. if you are in India the nearest root name server is at Tokyo. If the root name server at Tokyo is down,
all the DNS queries or traffic is diverted to server at Europe, which is the next nearest server to India.
NOTE:
1. By default DNS uses UDP at transport layer.
2. DNS can use either UDP or TCP.
3. In both cases the well known port number used by the server is port number-
53.
4. DNS query size< 512 byte ------ UDP
5. DNS query size>512 byte ------ TCP
E-mail, SMTP, POP, IMAP
E-mail

Email[Electronic Mail]

Sender Receiver

ll)
Sender Mail Receiver Mail
(P

(Pu
Server
us

Server Pop-3
SMTP
h)

Or
SMTP IMAP - 4

Internet

Gmail Yahoo
SMTP(Simple mail transfer protocol)

Ø The objective of SMTP is to transfer the email reliably and efficiently.


Ø It uses port number-25 at TCP.
Ø SMTP is text based protocol.
Ø With the help of SMTP & POP we can send only text messages.
Ø SMTP can only handle the message containing 7 bit ASCII text.
SMTP(Simple mail transfer protocol)

Ø SMTP cannot transfer other types of data like images, video, audio, etc.
Ø SMTP cannot transfer binary files or executable files.
Ø SMTP cannot transfer the text data for the language other than English (such as French, Japanese,
and Chinese etc.).
Ø Only SMTP is not sufficient to send binary files or to send videos or audio so we require MIME
(Multipurpose Internet mail extension).
Ø MIME is a supplementary protocol that allows non-ASCII data to send through SMTP.
Ø MIME is a set of software function that transforms non-ASCII data to ASCII data or vice versa.
Ø MIME is used to convert non text data to text data and text data to non text data.
NOTE (imp.)

Transfer the message from sending mail server to receiving mail server is done
through SMTP. Finally the message from receiving server to web browser is done
through HTTP only
POP3 IMAP
Mails can be accessed from multiple
(1) Mails can only be accessed from a single device.
device.
(2) Download the email from server to a
The email message is stored on the
single computer and the copy at the
mail server itself.
server is deleted.
(3) User cannot organize the mails in the mail box User can organize mails on the mail
of the mail server. server.
(4) It does not allow user to sync emails. It allows user to sync their emails.
(5) It is unidirectional i.e all the changes made on a
It is bidirectional i.e. all the changes made on
device does not effect the content present on the
server or device are made on the other side too.
server.
File Transfer Protocol (FTP)

1. File transfer protocol is a standard internet protocol for transferring files b/w
computers over TCP/IP connection.
2. It uses port number - 20 & 21 on TCP.
3. It has two types of connection
(i) Control connection (port number. - 21)
(ii) Data connection (port number - 20)
4. Control connection remains connected during the entire interactive FTP
session.
5. The data connection is opened and closed for each file transfer activity.

Continued....
6. When user starts an FTP session, the control connection opens. While the control
connection is open, the data connection can be opened and closed multiple times if
several files are transferred.
7. FTP uses persistent TCP connections for control information.
8. FTP uses Non-persistent TCP connections for data information.
9. FTP is a connection-oriented protocol.
10. FTP is an “out of band” protocol as data and control information flow over different
connection.
11. Some protocols send their request and data in the same TCP connection for this
reason they are called as In-band protocol.
12. HTTP & SMTP are In-Band protocol.
13. FTP is state full protocol.
HTTP Protocol
1. HTTP protocol used mainly to access data on word wide web (www)
2. It is client server protocol using port No - 80 on TCP
3. HTTP is “In-Band” protocol i.e. both request and data we will send only in one
connection.
4. HTTP is a stateless protocol i.e. It does not maintain any information of user.
5. There are two types of HTTP protocol
(i) Non persistent (1.0)
(ii) Persistent (1.1)
Non persistent(1.0)

In a Non persistent connection one TCP connection is made for each request/response.
This strategy follow the following steps :-
(i) The client opens a TCP connection and sends a request.
(ii) Server sends the response and closes the connection.
(iii) In this strategy , If a file contains link to N-different pictures in different files(all
located on same server) the connection must be opened and closed N+1 times.
Persistent (1.1)

1. In a persistent connection the server leaves the connection open for more request
after sending a response.
2. The server closes the connection at the request of client or time out has been
reached.
Importante table

Application Port Number. Transport Protocol


DNS 53 UDP
HTTP 80 TCP
20 (Data connection)
FTP TCP
21(Control connection)
SMTP 25 TCP
POP 110 TCP
SNMP 161, 162 UDP
TFTP 69 UDP
IMAP 143 TCP
Telnet 23 TCP
67 (DHCP Server)
DHCP UDP
68 (DHCP Client)
QUESTION

Which one of the following uses UDP as the transport protocol?


[GATE 2017]
A HTTP B Telnet

C DNS D SMTP
TCP UDP
SMTP DNS
HTTP SNMP
FTP TFTP
POP DHCP
IMAP All real time &
Telnet Multimedia
Protocol
QUESTION

Which of the following transport layer protocols in used to support electronic mail?

A SMTP B IP

C TCP D UDP
QUESTION

The transport protocols used for real time multimedia, file transfer, DNS and email,
respectively are

A TCP, UDP, UDP and TCP B UDP, TCP, TCP and UDP

C UDP, TCP, UDP and TCP D TCP, UDP, TCP and UDP
Importante table

SHORT TRICK DNS HTTP SMTP POP IMAP FTP


Stateful/
Stateless Stateless Stateless Stateful Stateful Stateful
Stateless

Transport Protocol Used UDP TCP TCP TCP TCP TCP

Connectionless/ Connection Connection Connection


Connection oriented Connection oriented Connection oriented
Connection oriented less less oriented

Control connection is
HTTP 1.0 is non
persistent. Data
Persistent/Non-persistent Non-persistent persistent HTTP 1.1 Persistent Persistent Persistent
connection is non-
is persistent.
persistent.

Push/Pull - - Push Pull Pull Can’t

20 for data
Port Number Used 53 80 25 110 143 connection. 21 for
control connection.

In band/
In band In band In band In band In band Out-of- band
Out-of-band
QUESTION

Which of the following is / are example(s) of stateful application layer protocols?


(i) HTTP
(ii) FTP
(iii) TCP
(iv) POP3

A (i) and (ii) only B (ii) and (iii) only

C (ii) and (iv) only D (iv) only


Stateless Stateful
DNS POP
HTTP IMAP
SMTP FTP
QUESTION

Consider different activities related to email


m1: Send an email from a mail client to a mail server
m2: Download an email from mailbox server to a mail client
m3: Checking email in a web browser
Which is the application level protocol used in each activity?

A m1: HTTP m2: SMTP m3: POP B m1: SMTP m2: FTP m3: HTTP

C m1: SMTP m2: POP m3: HTTP D m1: POP m2: SMTP m3: IMAP
QUESTION

Which of the following protocol pairs can be used to send and retrieve e-mails (in that
order?)

A IMAP, SMTP B SMTP, POP3

C IMAP, POP3 D SMTP, MIME


QUESTION

In one of the pairs of protocols given below, both the protocols can use multiple TCP
connections between the same client and the server. Which one is that?

A HTTP, FTP B HTTP, TELNET

C FTP, SMTP D HTTP, SMTP


Commands

HTTP FTP SMTP


GET USER HELO
HEAD PASS MAIL FROM
PUT ACCT RCPT TO
POST CWD DATA
TRACE REIN QUIT
DELETE QUIT RSET
CONNECT PORT* VRFY
OPTIONS PASV NOOP
TYPE TURN
MODE EXPN
PROMPT HELP
STRU SEND FROM
SMOL FROM
SMAL FROM
FTP Command shortcut

तम
ु $फर से U P आ रहे +या $फर चल0गे पीने
TM P S U P A R Q P C P

Mode STRU PASV REIN PROMPT PASS

Type Part USER ACCT Quit CWD


SMTP Commands

Vikas VRFY
Sir SEND FROM
Teaches TURN
Hard HELO
Subject SMOL FROM
iN NOOP
Easy EXPN
Manner MAIL FROM
Difficult DATA
Subject SMAL FROM
Re Quires RSET, QUIT
Ha Rdwork HELP, RCPTTO
HTTP Commands

”Tumhe Dena hai OCG papaya"


T-Trace
D-Delete
H-head
O-option
C-connect
G-get
P-push
P-put

OCG is a Verity of papaya


QUESTION

HELO and PORT, respectively, are commands from the protocols


(GATE 2016 IT)

A FTP and HTTP B TELNET and POP3

C HTTP and TELNET D SMTP and FTP


QUESTION

Consider the three commands : PROMPT, HEAD and RCPT. Which of the following
options indicate a correct association of these commands with protocols where there
are used ?
(GATE 2005)

A HTTP, SMTP, FTP B FTP, HTTP, SMTP

C HTTP, FFP, SMTP D SMTP, HTTP, FTP


QUESTION

Identify the correct sequence in which the following packets are transmitted on the
network-by a host when a browser requests a webpage from a remote server, assuming
that the host has just been restarted.
(GATE 2016)

A HTTP GET request, DNS query, TCP B DNS query, HTTP GET request, TCP
SYN SYN
C DNS query, TCP SYN, HTTP GET D TCP SYN, DNS query, HTTP GET
request request
QUESTION

Assume that you have made a request for a web page through your web browser to a
web server. Initially the browser cache is empty. Further, the browser is configured to
send HTTP requests in non-persistent mode. The web page contains text and five very
small images. The minimum number of TCP connections required to display the web
page completely in your browser is ________.
OSI and TCP/IP
Protocol Stack
Functions of Computer Network

Functions

Mandatory Optional

Error control Encryption & Decryption


Flow control Check pointing
Access control Routing
Multiplexing and Demultiplexing :
: :
:
OSI/ISO

OSI : Open systems Interconnection model.


ISO : International Standards Organization. It is a multinational body dedicated to
worldwide agreement on international standard.
OSI Model

• This model has been proposed by ISO.


• An open system is a set of protocols that allows any two different systems to
communicate regardless of their underlying architecture
(Hardware/Software).
• The purpose is to show how to facilitate communication between different
systems without requiring changes to the logic of the underlying hardware &
software.
• This model has got 7 separate but related layers.
Functions of Physical layer

Physical Layer is responsible for movement of individuals bits from one Hop to next
Hop.
Functions of Physical layer

1. It is used to define electrical, mechanical, functional and procedural


characteristic of physical link.
(physical Link)
Copper → Electrical signal
Fiber → Light signal
Wireless comm. → Electromagnetic signal.
2. It defines transmission mode:
a. Simplex
b. Half duplex
c. Full duplex
Functions of Physical layer

3. It defines topology configuration:


• Bus topology • Star topology
• Mesh Topology • Tree Topology

4. It is totally Hardware layer.


5. It defines link configuration:
i Point to Point Link
ii Broadcast Link

6. It defines Encoding.
7. Bits Synchronization.
8. Bit rate control.
Data Link Layer

Data link layer is responsible for moving frames From One Hop (Node) to Next Hop
(Node).
Function of data link layer

1. Flow control
LLC Flow Control
2. Error control Error Control
3. Access control MAC Synchronization

4. Framing
5. Physical Addressing Framing

Data Link Layer is divided into two parts Physical Addressing


Access control
Network Layer

The network layer is responsible for the delivery of individual packet from source
to destination.
Network Layer: The network layer is responsible for the delivery of individual
packet fromLayer
Network source to destination(Host to host)

Function of Network Layer


1. Host to Host connectively:
2. Logical Addressing: Header of network layer contains logical address(IP
Address) of sender and receiver
3. Switching:

4. Routing:

5. Fragmentation:

6. Congestion control: If no. of packets present in the network is greater than


the no. of packet it can handle. Then we can say congestion has occurred.
Transport Layer

Transport Layer is responsible for process to process delivery. A process is an


application program running on a host.

Function of Transport Layer

1. End to end connectively 5. Segmentation and Reassembly


2. Service point Addressing 6. Congestion control
3. Flow control 7. Connection Control
4. Error control 8. Multiplexing and Demultiplexing.
Session Layer

Session layer also known as network dialog controller. It establishes, maintains,


synchronizes and terminates the interaction b/w sender and receiver.

Function of Session Layer

1. Authentication & Authorization


2. Check point or synchronization
3. Dialog control
Presentation Layer

This layer take care of syntax and semantics of the information exchange in
between two communicating systems.

Function of Presentation Layer

1. Character translation
2. Encryption/Decryption
3. Compression
Application Layer

Application Layer is responsible for providing services to users. Users such as:
1. Mail services
2. File sharing
3. File transfer and many more
Q.1 The protocol data unit (PDU) for the application layer in
the Internet stack is

A Segment

B Datagram

C Message

D Frame
Q.2 Assume that source S and destination D are connected
through two intermediate routers labelled R. Determine
how many times each packet has to visit the network layer
and the data link layer during a transmission from S to D

A Network layer – 4 times and Data link layer – 4 times

B Network layer – 4 times and Data link layer – 3 times

C Network layer – 4 times and Data link layer – 6 times

D Network layer – 2 times and Data link layer – 6 times


Q.4 Which one of the following options encapsulates packet ?

A Segment

B Frame

C PDU

D Datagram
Q.5 Which layer is responsible for Segmentation & reassembly ?

A Application layer

B Data Link layer

C Transport layer

D Presentation layer
Q.6 Consider the following scenario where source and
destination are connected via three intermediate Router

Let P be the number of times the packet visit Network


Layer and G be the number of times the packet visit data
link layer during a transmission of packet from source to
destination. The value of P + Q is:
You

You might also like