Questions tagged [tcp]

For questions about Transmission Control Protocol (TCP), a transport protocol used to encapsulate data across a network for reliable communication.

Filter by
Sorted by
Tagged with
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 ...
smwikipedia's user avatar
  • 1,953
3 votes
2 answers
2k views

Why do transport layer do data chunking. If there is fragmentation in Network Layer

I just curiously wanted to know about the question regarding L4, L3 Data Chunks, IP Fragmentation : Data chunking happened at Layer 4(Transport, TCP), and Fragmentation at Layer 3(Network, ipv4) ...
user avatar
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?
Marcos Gonzalez's user avatar
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. ...
Zach Smith's user avatar
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 ...
user2449761's user avatar
6 votes
2 answers
3k views

What is the reason for the different order of the Source and Destination in a L2 header?

A TCP/UDP header (Layer 4) lists the Source Port, then the Destination Port: An IP header (Layer 3) lists the Source IP, then the Destination IP: An Ethernet header (L2) and a WiFi Header (L2) lists ...
Eddie's user avatar
  • 15k
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 ...
NetworkNinja's user avatar
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 ...
Luna's user avatar
  • 131
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, ...
fundagain's user avatar
  • 169
7 votes
3 answers
5k views

How does NAT decide which connections are inbound, and which are outbound?

I'm building a P2P application that needs to be able to access nodes behind a NAT. This NAT does not allow inbound connections, therefore the nodes outside the network cannot reach out to the nodes ...
Dean M.'s user avatar
  • 73
5 votes
2 answers
7k views

How does a layer-2 switch work with UDP?

If UDP and/or TCP send packets via IP to an Internet Protocol Address, how can a layer-2 switch forward these? Is this possible or do you need a layer-3 switch?
user_ABCD's user avatar
  • 614
2 votes
1 answer
478 views

Message formatting and encapsulation

I've gotten confused when reading about encapsulation and the OSI and TCP/IP models. I first read about message formatting and encapsulation and the diagram I read showed: Destination | Source and ...
The_Bear's user avatar
  • 515
1 vote
2 answers
646 views

Which port determines the protocol?

If we have a common protocol port on both ends.. say source point is 443 and destination port is 80 (hypothetical situation, I know this combination of ports probably makes no sense).. how do we ...
Jack's user avatar
  • 13
0 votes
1 answer
336 views

Confused with packet reordering

I was reading a textbook which says about TCP protocol "Selective Repeat": We have assumed that packets cannot be reordered within the channel between the sender and receiver. This is ...
amjad's user avatar
  • 421
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 ...
guidev's user avatar
  • 563
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 ...
John Dorian's user avatar
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
John T's user avatar
  • 303
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 ...
knotseh's user avatar
  • 2,535
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 ...
czhao's user avatar
  • 253
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?
Елена Кокчева's user avatar
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. ...
Mahesha999's user avatar
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 ...
user10433098's user avatar
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 ...
Juicy's user avatar
  • 379
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 ...
THE DOCTOR's user avatar
8 votes
4 answers
17k views

Why is a TCP Socket identified by a 4 tuple?

Newbie to networking here. I'm reading the Computer Networking (3rd edition) book, and in section 3.2 they are discussing multiplexing / demultiplexing for both UDP and TCP. In the UDP protocol, a ...
Steven L.'s user avatar
  • 183
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 ...
Shadi's user avatar
  • 285
8 votes
5 answers
738 views

Why is the IP layer aware of higher layers in the network stack?

In the IP packet header there is an 8-bit Protocol field (at offset 9) that holds the "next level protocol", with assigned numbers given in RFC 790. For example, TCP is 6. My question is, why is the ...
I. J. Kennedy's user avatar
7 votes
1 answer
44k views

Troubleshooting "TCP Zero Window" Issues

I'm currently having a problem troubleshooting a trading application. Let me give a simple diagram of the current network setup (Gov't Stock Exchange Network Router)X-->(256kbs Leased Line)<--X(...
Rufi's user avatar
  • 111
7 votes
1 answer
5k views

How do Endpoints in a TCP conversation determine their MSS?

I understand the MSS is the Maximum Segment Size, which is the size of the Payload TCP will send. I also understand that a "receiving" MSS value is suggested by both parties in a TCP conversation ...
Eddie's user avatar
  • 15k
5 votes
2 answers
22k views

Why only after 3-duplicate ACK retransmission takes place in TCP?

Is there any reason of choosing "3" only for retransmission. why not 2 or 4 or any other number?
0x47-sci-tech's user avatar
4 votes
1 answer
756 views

What happens in SACK when there are multiple gaps in the received packets?

Suppose a client has received 0 to 500, 900 to 1100 and 1300 to 2000 how will ACK and SACK look like? Does it look like this ACK: 500 SACK:900-1100 and then it asks for the packets 1100 to 1300 in new ...
ds459's user avatar
  • 353
3 votes
1 answer
3k views

What is the need for transport Layer?

In 5-layer model. Why we need additional transport layer? I read these two points Users who interact with software have no control over the sub-net; Transport Service can provide a more reliable ...
ashok's user avatar
  • 585
3 votes
1 answer
7k views

What is the value of EstimatedRTT at first time?

Although this question might be marked as duplicated! I'm asking again because other question's answers like this couldn't help me. So please consider the case and don't mark it as duplicate and ...
Showkat Ali's user avatar
3 votes
1 answer
5k views

How to understand the sequence number of segments in TCP termination process in TCP/IP Illustrated, Volume 1: The Protocols (2nd Edition)?

I read about TCP/IP Illustrated, Volume 1: The Protocols (2nd Edition) 13.2 TCP Connection Establishment and Termination, and the following picture shows the TCP connection and termination process, ...
cong's user avatar
  • 145
2 votes
2 answers
566 views

single connection over multiple internet connections

Hi not sure where to ask this thought this would be the best place, i was just wondering if it was at all possible to have a single connection get the benefit of multiple internet connections. For ...
Kr0nZ's user avatar
  • 23
2 votes
1 answer
10k views

Iperf results on UDP Bandwidth

I am currently testing iperf with a view to automating some testing servers for our company. To do this I am using an iperf server in the cloud which is well connected and is only 5 hops away from ...
Paula Livingstone's user avatar
2 votes
2 answers
617 views

Should all sent segments be requeued after a TCP retransmission timeout expires?

I am developing a TCP implementation and could not find a clarification to this in the relevant RFCs (793, 1122, 5681, 6298). When the retransmission timer expires, the first segment which has once ...
Ambroz Bizjak's user avatar
2 votes
1 answer
249 views

Why does TCP need more than just one port?

With TCP you listen to some port (say port 80) and then when an incoming connection pops up, you accept it, establishing the connection over a new port. Why is this necessary? Why can't you just keep ...
user541686's user avatar
1 vote
2 answers
2k views

How to calculate the Maximum Segment Size (MSS)?

This page says the following: TCP controls this maximum size, known as Maximum Segment Size (MSS), for each TCP connection. For direct-attached networks, TCP computes the MSS by using the MTU size of ...
user4582812's user avatar
1 vote
1 answer
259 views

How UDP checksum get IP address to make pseudo header in transport layer?

We know that UDP checksum's pseudo header contains the most important parts of the IP header, that is, source and destination address, protocol number and data length. I hope that the concept of IP ...
S. M.'s user avatar
  • 378
1 vote
2 answers
1k views

How is UDP used in multimedia system inspite of being connectionless

We know that UDP does not care about segment (packet) in-order and their arrival on the destination.Then how on YouTube or VoIP (skype) are we able to stream videos? If a packets is lost (doesn't ...
S. M.'s user avatar
  • 378
1 vote
1 answer
455 views

how data are fragmented based on MTU and MSS?

just to be clear.. if a sender wants to send a data of 1800bytes ( assuming MTU be 1500bytes so MSS = 1500-40 (taking min ip and tcp header) = 1460bytes) Then there will be three segments 750 + 750 + ...
AxDu's user avatar
  • 13
1 vote
1 answer
378 views

I have issue with MSS and window size [duplicate]

I made a short example because I have tried understanding the difference between MSS and window size in tcp header when we consider a sender and a receiver. So let's say sender and receiver use the ...
eyesima's user avatar
  • 113
1 vote
2 answers
158 views

How TCP connections between origin and node servers over a BGP Anycast gets established?

Server A and B have the same IP address with anycast. Server B connects to the origin server that is very close to server A and very far away from server B, since server A is closer, the response will ...
Amin Vakil's user avatar
0 votes
2 answers
310 views

If you're behind a firewall and all the ports are blocked, how is your browser able to access the internet? [closed]

I'm behind a router and I'm able to run game servers on my home computer after forwarding ports or using the DMZ feature on the router. However, I still don't understand the underlying technology as ...
user3163495's user avatar
0 votes
2 answers
4k views

What will happen at server side if it received 2 SYN packet from the same client application?

A server moves to SYN_RECV state once it gets a SYN packet from a client application. What will happen at server side if it received 2 SYN packet from the same client application?
vikas's user avatar
  • 11
0 votes
1 answer
3k views

TCP Handshaking Meaning of RST

I am trying to implement TCP handshaking but receive RST instead of ACK: No. Time Source Destination Protocol Length Info 62 24.622012890 192.168.0.147 ...
Amanda Punch's user avatar
0 votes
1 answer
165 views

What steps must be accomplished in each layer of the TCP/IP model to connect a website?

What steps must be accomplished in each layer of the TCP/IP model to connect a website?
ShooterLens Aim's user avatar
0 votes
2 answers
848 views

Is TCP's MSL value equivalent to IP's TTL value?

Definition of MSL according to RFC 793: Maximum Segment Lifetime, the time a TCP segment can exist in the internetwork system. Arbitrarily defined to be 2 minutes. Definition of TTL according to ...
Argon's user avatar
  • 113
-1 votes
1 answer
426 views

Why the pseudo-header is not transmitted with the UDP datagram?

I have read from E. Comer - Internetworking with TCP/IP 4th edition that "The purpose of using a pseudo-header is to verify that the UDP datagram has reached its correct destination. The key to ...
S. M.'s user avatar
  • 378