Questions tagged [tcp]
For questions about Transmission Control Protocol (TCP), a transport protocol used to encapsulate data across a network for reliable communication.
792
questions
184
votes
9
answers
112k
views
Why do we need a 3-way handshake? Why not just 2-way?
The TCP 3-way handshake works like this:
Client ------SYN-----> Server
Client <---ACK/SYN---- Server
Client ------ACK-----> Server
Why not just this?
Client ------SYN-----> Server
...
78
votes
5
answers
508k
views
Ping port number?
Yesterday interviewer asked me what is the port number for ping and which protocol ping uses: TCP or UDP.
After interview, I searched on the Internet and found different results: someone says ICMP ...
61
votes
10
answers
100k
views
Why only port 80 for web services?
Why isn't it sensible to dedicate more than one TCP/IP port to http? Although admittedly naive, isn't it intuitive to think that server performance could somehow be increased?
45
votes
3
answers
130k
views
What is the difference between MSS and MTU?
I'm confused as to the difference between maximum segment size and a maximum transmission unit.
Can someone please explain in relation to layers 2 and 3?
If I had a packet of 800 bytes in the ...
44
votes
7
answers
16k
views
Does UDP do anything at all?
It's my understanding that TCP has logic for ensuring reliable communication, but UDP just naively sends information along the channel set up for it using IP and things in lower layers.
Does UDP ...
31
votes
8
answers
35k
views
Why does DHCP use UDP and not TCP?
DHCP uses UDP as its transport protocol. DHCP messages that a client sends to a server are sent to well-known port 67 (UDP—Bootstrap Protocol and DHCP). DHCP Messages that a server sends to a client ...
29
votes
7
answers
8k
views
Why isn't UDP with reliability (implemented at Application layer) a substitute of TCP?
TCP provides reliability at transport layer while UDP does not. So, UDP is fast.
But, a protocol at application layer can implement reliable mechanism while using UDP.
In this sense, why isn't UDP ...
25
votes
4
answers
12k
views
Does physical distance affect download speed?
I just had an argument with a colleague of mine and thought I'd just reach out to the experts on this. Here's the scenario. We were using a website that measures your connection's speed. We tested ...
23
votes
1
answer
13k
views
Is a TCP server limited to 65535 clients?
There are 65535 TCP port numbers, does that mean only 65535 clients can connect to a TCP server?
One might think that this places a hard limit on the number of clients that a single computer/...
22
votes
1
answer
22k
views
How multiple client connections are made to single web server?
Actually I am learning Computer Networks and while at it, I am confused in how a web server maintains multiple connections?
Simply to state, I learned trough some googling is that sockets handles a ...
21
votes
5
answers
5k
views
Why is Packet Size Limited?
I was reading: this answer to "Maximum packet size for a TCP connection", where it says:
The absolute limitation on TCP packet size is 64K (65535 bytes), but
in practicality this is far ...
20
votes
3
answers
10k
views
What do TCP/UDP add to "raw ip"?
I know that both TCP and UDP are built on top of IP, and I know the differences between TCP & UDP, but I'm confused about what exactly "raw ip" is. Would it be fair to say that TCP & UDP both ...
19
votes
5
answers
4k
views
How is 8 bits sufficient for the TTL in an IP header?
The TTL (Time to Live) is an 8-bit field in the IPv4 header. It can take any value from 0 to 255. If this means that the packet can take a maximum of 255 hops (routers) on its way to its destination, ...
18
votes
1
answer
146k
views
What does TCP DUP ACK mean?
In Wireshark, I see TCP duplicate ACK packets sent from the receiver to the sender. What does it mean? Does it imply packet loss?
Thank you
17
votes
3
answers
4k
views
Why does one say IP fragmentation is bad and to be avoided when in reality data always needs to be fragmented for MTU compatibility?
Why does one say fragmentation is bad and must be avoided due to performance issues when in reality fragmentation intrinsically occurs within the communication ?
Example:
User1 wants to send 100 000 ...
15
votes
8
answers
27k
views
Does TCP open a new connection for every packet that is sent?
This might be a silly question but a me and few buddies have been discussing the potential limitations of TCP. We have an application that is going to listen for clients (think of a gateway) and route ...
15
votes
7
answers
16k
views
TCP acceleration over satellite or high latency networks [closed]
What viable companies, products or options are out there today for TCP Acceleration over satellite or high latency IP networks?
The average satellite RTT is upwards from 600ms (depends on the ...
15
votes
3
answers
35k
views
What is the purpose of TIME WAIT in TCP connection tear down?
I found that the reason the active closer enters TIME WAIT is to make sure that the final ACK is not lost. But how does it know if the final ACK is lost? Will the passive closer resend the FIN and ...
14
votes
1
answer
14k
views
How can a TCP window size be allowed to be larger than the maximum size of an ethernet packet?
I know that TCP window sizes can be scaled to over 64KB, but looking at an ethernet packet datagram, such as this one:
it looks like a layer 2 packet is limited in size to be much smaller than that. ...
14
votes
1
answer
2k
views
Why BGP implements its own keepalive instead of using tcp keepalive?
BGP doesn't use TCP keepalive, it uses its own keepalive mechanism. My question is why can't bgp turn-on the SO_KEEPaLIVE of TCP and live happily? why does it not use tcp keepalive and implement its ...
14
votes
1
answer
6k
views
Troubleshooting low Metro Ethernet TCP throughput
Background
We rented a few layer 2 leased lines, i.e. you have one big pipe at the datacenter and the remote sites have smaller pipes. Inside the layer 2 network you can do whatever you like. Probably ...
13
votes
3
answers
18k
views
Is a TCP three-way handshake required for an HTTP POST?
I don't quite understand if i posting http form data from the browser to the server, does the protocol still need to make three-way handshake (syn-ack-data) or it only works for GET http requests?
13
votes
6
answers
14k
views
How does BGP work over TCP?
As far as I know we are using routing protocols to achieve Layer 3 connectivity, I am confused with the fact that BGP works over TCP which is L4. How can L4/TCP be established without prior L3 ...
13
votes
3
answers
3k
views
acknowledgment by TCP does not guarantee that the data has been delivered
In RFC 793 there is a part about the acknowledgment of TCP segments:
When the TCP transmits a segment containing data, it puts a copy on a
retransmission queue and starts a timer; when the ...
13
votes
4
answers
3k
views
How can I formulate the communication latency in TCP/IP?
I have difficulty in deriving a mathematical model/equation to estimate the round trip latency between two nodes communicating using TCP/IP. The nodes are exchanging data based on HTTP protocol. In ...
13
votes
1
answer
2k
views
Why in TCP the first data packet is sent with "sequence number = initial sequence number + 1" instead of "sequence number = initial sequence number"?
In the 3-way handshake, the initial sequence number of both endpoints of the TCP connection is synchronized.
Here is an example:
Endpoint A randomly generates an initial sequence number: 123.
...
13
votes
2
answers
5k
views
How NAT / PortForwarding / TCP/IP works?
I recently read an article entitled how NAT works. Some things still remain unclear to me. I would be thankful if someone could explain.
Below is the part of the article regarding DynamicNAT that is ...
13
votes
3
answers
35k
views
Wifi TCP iperf throughput: 1 stream vs multiple streams?
In a WLAN iperf TCP throughput test, multiple parallel streams will give me higher throughput than 1 stream. I tried increasing the TCP window size, but I still cannot achieve the max throughput with ...
13
votes
2
answers
30k
views
Open a range of TCP ports in Cisco IOS NAT
ip nat inside source static 192.168.1.10 10.10.10.9 route-map RANGE
!
route-map RANGE permit 100
match ip address 102
!
access-list 102 permit tcp host 192.168.1.10 range 3000 3389 any
The ...
12
votes
4
answers
41k
views
How to know whether a protocol uses TCP or UDP
Well I know that might sound a stupid question and I believe that the most proper answer will be like I will be able to tell as my experience builds up and I learn more and more about the protocols.
...
12
votes
4
answers
22k
views
Can anyone explain to me the difference between the PSH and URG flags in TCP segment?
According to me when PSH flag is set, it indicates that data will have to be sent immediately to the wire and on receiving side the data has to be pushed to the application immediately.
When URG flag ...
12
votes
2
answers
14k
views
Why maximum length of IP, TCP, UDP packet is not suit?
From many tutorials, I get follow knowledge(maybe I'm misunderstood) :
maximum of an Ethernet packet is about 1500 bytes.
maximum of an IP packet is about 65535 bytes.
maximum of a UDP packet is ...
11
votes
3
answers
10k
views
What happens when SYN and FIN flags in TCP headers are both set to 1?
In TCP header, what happens when both SYN and FIN flags are set to 1? Or, can both even be simultaneously set to 1 ?
11
votes
2
answers
27k
views
Trying to find out exact TCP overhead cost
Corresponding this topic:
https://stackoverflow.com/questions/3613989/what-of-traffic-is-network-overhead-on-top-of-http-s-requests
The maximum segment size (which does not include the TCP or IP
...
11
votes
2
answers
3k
views
How does nmap distinguish closed ports from filtered ports
Let's suppose we are doing a TCP connect scan.
a nmap scan on google returns the following output :
PORT STATE SERVICE
80/tcp open http
443/tcp open https
However, if I try to ...
11
votes
2
answers
3k
views
Why does FTP passive mode use a range of ephemeral ports as opposed to a single well known port? [closed]
In FTP passive mode, I read that the server sends a random port number to the client where it can establish a data channel.
Then client establishes a data channel from its random port number to this ...
11
votes
2
answers
28k
views
Window Size and ACK Number
Copy-pasting from my lecturer's slides:
• Receiver indicates the window size is 3000
• Transfer goes ahead
• Acknowledge every 3000 bytes
• Receiver increases window size to 4000
• 4000 bytes ...
11
votes
1
answer
618
views
Is a FIN only segment legal?
It would be convenient to mark TCP segments with just the FIN flag set, as an intrusion (without tracking the reply).
I have always assumed that a FIN without an ACK, while rude and rare, is legal, ...
10
votes
5
answers
5k
views
Does the destination port change during TCP three-way handshake?
I'm learning networking programming in C and there is a question bothers me a lot, does the destination port change during TCP three-way handshake? Let's say I have a cilent application running on ...
10
votes
3
answers
7k
views
How HTTP is converted to TCP and then how TCP converted to IP?
I know that in Internet Protocol Stack there are actually three layer. They are Application, Internet and Transport. Let's say HTTP in Application layer will be converted to TCP in Transport layer and ...
10
votes
3
answers
23k
views
Traceroute Over TCP vs UDP
For what purpose would one wish to send traceroute over TCP rather than UDP? What advantages/disadvantages are there in doing so? I know that traceroute normally uses UDP ICMP "echo" packets while ...
10
votes
2
answers
5k
views
Is TCP maximum segment size (MSS) "clamping" compatible with IPv6?
With IPv4, TCP MSS "clamping" (a network device editing the MSS value in a TCP header) can help when path maximum transmission unit discovery is not working. (e.g., when ICMP is being blocked ...
10
votes
4
answers
11k
views
TCP port 0 reserved for what purpose?
I was asked a question my one of my teachers. What is TCP port 0 reserved for? I did a bit of searching and research found 2 reasons:
For linux based system, to get the next available port from the ...
10
votes
5
answers
6k
views
Packet sizes in a TCP stream
I'm network traffic and wish to divide each TCP session into a series of requests and responses (the protocols I'm working with all work that way, like HTTP or SSL).
I had a simple assumption (...
10
votes
3
answers
8k
views
How is tcp/ip implemented
Well, first of all I am new to networking.
And I have studied the layered structure of tcp/ip protocol stack.
I know that the layered structure is an abstract model, but I didn't know how the ...
9
votes
4
answers
16k
views
How would a firewall kill a TCP connection without RST or FIN? [closed]
Situation is like this:
http client ----> corporate firewall ----> http server
Due to a keepalive, server and client would keep TCP connections open and the client would use a connection pool ...
9
votes
4
answers
12k
views
How is a TCP connection maintained over a changing IP address
I remember when I connected to the internet via the phone line and a 56kbps modem, changing ISPs was as simple as changing the phone number dialled by the modem.
I remember that my IP address would ...
8
votes
6
answers
4k
views
How Does A Layer 2 Switch Differentiate Between Different Networks?
I know that different IP-based networks can be connected to the same layer-2 switch. and I know each network's nodes can communicate just fine, however, no normal traffic can occur between two nodes ...
8
votes
6
answers
5k
views
Could IPv6 make NAT / port numbers redundant?
From what I can tell, each process could get its own IP address, with loads of IP's to spare.
What would the drawbacks be?
Essentially, your host would become a router and each process is a host (in ...
8
votes
3
answers
11k
views
Packet forwarding in TCP vs UDP
Recently I had a discussion about differences between TCP and UDP, and the other person insisted that there's a difference in packet forwarding: The packets in a TCP connection follow an established ...