KEMBAR78
IT-304 Computer Networks: Ans: in This Case, The Host Will Send A Special Reset Segment To The Source | PDF | Transmission Control Protocol | Port (Computer Networking)
0% found this document useful (0 votes)
108 views3 pages

IT-304 Computer Networks: Ans: in This Case, The Host Will Send A Special Reset Segment To The Source

This document summarizes key concepts in computer networks and TCP/IP protocols. It discusses how TCP connections are established, what happens when a TCP segment does not match an open port, how sequence and acknowledgment numbers work in TCP, and provides examples of port numbers used in telnet sessions. The document answers questions about sequence numbers, acknowledgment numbers, and possible port numbers used in communication between clients and servers.

Uploaded by

Dev Joshi
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)
108 views3 pages

IT-304 Computer Networks: Ans: in This Case, The Host Will Send A Special Reset Segment To The Source

This document summarizes key concepts in computer networks and TCP/IP protocols. It discusses how TCP connections are established, what happens when a TCP segment does not match an open port, how sequence and acknowledgment numbers work in TCP, and provides examples of port numbers used in telnet sessions. The document answers questions about sequence numbers, acknowledgment numbers, and possible port numbers used in communication between clients and servers.

Uploaded by

Dev Joshi
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
You are on page 1/ 3

IT-304 Computer Networks

201901161

1. When both the client and the server are prepared to communicate, i.e.,
that the server is listening on the port to which the client sends its SYN
segment, a TCP connection can be easily established. Now, consider what
happens when a host receives a TCP segment whose port numbers or
source IP address do not match with any of the incoming sockets in the host.
For example, suppose a host receives a TCP SYN packet with destination
port 80, but the host is not accepting connections on port 80 (that is, it
is not running a Web server on port 80). What will happen in this case?
Ans: In this case, the host will send a special reset segment to the source.
This TCP segment has the RST flag bit set to 1. Therefore, when a host
sends a reset segment, it is telling the source that “I don’t have a socket
for that segment. Please do not send the segment”.

2. Host A and B are communicating over a TCP connection, and Host B has
already received from A all bytes up through byte 126. Suppose Host A then
sends two segments to Host B back-to-back. The first and second segments
contain 80 and 40 bytes of data, respectively. In the first segment, the
sequence number is 127, the source port number is 302, and the destination
port number is 80. Host B sends an acknowledgment whenever it receives
a segment from Host A.
(a) In the second segment sent from Host A to B, what are the
sequence number, source port number, and destination port
number?
Ans:
Sequence Number = 127 + 80 = 207.
Source Port Number = 302.
Destination Port Number = 80.
(b) If the first segment arrives before the second segment, in the
acknowledgment of the first arriving segment, what is the
acknowledgment number, the source port number, and the
destination port number?
Ans: Acknowledgement Number = 207.
Source Port Number = 80.
Destination Port Number = 302.

3. Suppose Host A sends two TCP segments back to back to Host B over a
TCP connection. The first segment has sequence number 90; the second
has sequence number 110.
a. How much data is in the first segment?
Ans: Data in the first segment = 110 – 90 = 20
b. Suppose that the first segment is lost but the second segment arrives
at B. In the acknowledgment that Host B sends to Host A, what will
be the acknowledgment number?
Ans: In the acknowledgment that Host B sends to Host A, then the
acknowledgment number will be first segment of sequence number,
that is 90.

4. Consider the Telnet example discussed in class. A few seconds after the
user types the letter ‘C,’ the user types the letter ‘R.’ After typing the
letter ‘R,’ how many segments are sent, and what is put in the sequence
number and acknowledgment fields of the segments?
Ans: When host A sends data = ‘R’ then segment is send with sequence
number = 43 and acknowledgment number = 80, to host B.
Host B, then sends, segment with data = ‘R’ (echoes-back ‘R’), sequence
number = 80 and acknowledgment number = 44, as a receipt.
Host A, then acknowledges receipt of echoed ‘R’ by sending segment
with sequence number = 44 and acknowledgment number= 81.
5. Suppose Client A initiates a Telnet session with Server S. At about the
same time, Client B also initiates a Telnet session with Server S. Provide
possible source and destination port numbers for
a. The segments sent from A to S.
Ans: The segments sent from A to S may have the source port number as
5602 and destination-port number as 23(Telnet).

b. The segments sent from B to S.


Ans: The segments sent from B to S may have the source port number as
1804 and destination port number as 23(Telnet). 23 is the port number
of the Server S.

c. The segments sent from S to A.


Ans: The segments sent from S to A may have the source port number as
23(Telnet) and destination port number as 5602.

d. The segments sent from S to B.


Ans: The segments sent from S to B may have the source port number as
23 and destination port number as 1804.

e. If A and B are different hosts, is it possible that the source port


number in the segments from A to S is the same as that from B to S?
Ans: Yes, it is possible that the source port number in the segments from
A to S is the same as that from B to S even when A and B are different
hosts. This is because IP addresses are also included in the segments to
recognize the correct host.

f. How about if they are the same host


Ans: No, the source ports would need to be different. It is not possible
that the source port number in the segments from A to S is the same as
that from B to S when they are the same hosts. The server to distinguish
the hosts uses IP addresses.

You might also like