The transport layer PDU is called a segment
The segment is the name given to a packet of data at the transport layer of a network. When your computer sends information across a network, that information gets broken into smaller pieces at different layers. At the transport layer — the fourth layer in the standard network model — those pieces are called segments. This is the layer where your device decides how to send data reliably, whether to check for errors, and how fast to push it out.
Understanding what a segment is helps you follow how data actually moves through a network. Each segment contains the data you want to send plus header information that tells the receiving computer how to reassemble everything and whether anything got lost along the way. The transport layer sits between the application layer above it (where your email or web browser lives) and the network layer below it (where IP addresses route packets across the internet).
Key Takeaways
- A segment is the PDU at the transport layer, containing both data and header information that manages how information reaches its destination.
- The two main transport protocols that create segments are TCP (which checks that data arrives completely and in order) and UDP (which sends data faster but does not verify delivery).
- Each segment includes source and destination port numbers, which tell the receiving computer which application should receive the data.
- Segments are created when data leaves your application and are reassembled into the original message when they arrive at the destination computer.
How segments differ from PDUs at other layers
Each layer of a network uses a different name for its packet of data. At the application layer, you work with messages. At the network layer, data is called a packet. At the data link layer, it becomes a frame. The transport layer's name — segment — marks the point where your computer takes responsibility for getting data to the right application on the receiving end, not just to the right computer.
This naming matters because it tells you what job each layer is doing. A frame gets data to the next physical device on the network. A packet gets data to the right computer using an IP address. A segment gets data to the right application on that computer using a port number. When you hear the word segment in a networking context, you know someone is talking about reliability, ordering, and port-based delivery.
TCP segments versus UDP segments
Two different protocols create segments at the transport layer, and they work very differently. TCP (Transmission Control Protocol) creates segments that include extra information to track whether data arrived, whether it arrived in the right order, and whether any pieces were lost. TCP segments are larger because they carry this overhead, but they may provide delivery. When you send an email or download a file, TCP is almost always handling the segments.
UDP (User Datagram Protocol) creates simpler segments with less overhead. UDP does not check whether the receiving computer got the data, and it does not care about order. This makes UDP segments smaller and faster to send, which is why video calls, online games, and live streaming use UDP. The trade-off is that you might lose a few segments, but the speed matters more than perfection in those cases.
Both create segments — the name stays the same — but the contents and behavior are different. When you troubleshoot network problems, knowing which protocol is in use tells you what to expect from the segments being sent.
What information a segment contains
A segment has two main parts: the header and the payload. The header contains the information the transport layer needs to do its job. This includes the source port (which application on your computer is sending), the destination port (which application on the other computer should receive it), and sequence numbers that help the receiving computer put segments back in the right order. TCP segments also include acknowledgment numbers and flags that confirm delivery and signal when connections start or stop.
The payload is the actual data you want to send — part of your email message, part of a web page, part of a file. The segment wraps this payload in the header information, and then passes the whole thing down to the network layer, which adds its own header with IP addresses and creates a packet. This layering is how networks organize the work of getting data from one place to another.
Why port numbers matter in segments
The port numbers in a segment's header are what make the transport layer different from the network layer. An IP address gets data to the right computer, but a computer might be running email, a web server, a file transfer service, and a dozen other applications at the same time. Port numbers tell the receiving computer which application should handle each segment. Port 80 usually means web traffic, port 25 usually means email, and port 22 usually means secure shell access.
When a segment arrives at a computer, the operating system reads the destination port number and hands the data to the correct application. If no application is listening on that port, the segment is discarded. This is why firewalls can block traffic by port number — they are reading the segment header and deciding whether to let it through based on the port.
How segments get reassembled into messages
Large files and messages do not travel as single segments. Your computer breaks them into multiple segments, each one small enough to fit through the network without getting lost. Each segment gets a sequence number in its header so the receiving computer knows what order to put them back in. When all the segments arrive, the transport layer on the receiving end reads those sequence numbers and reassembles the segments into the original message.
This is where TCP's extra work shows up. TCP keeps track of which segments arrived and which ones did not. If a segment is missing, TCP asks the sending computer to send it again. UDP does not do this — it just reassembles whatever segments showed up, in whatever order they arrived. For email and file downloads, you need TCP's reliability. For a video call, you can live with a few missing segments because the video keeps playing anyway.
Segment size and network performance
The size of a segment matters for network performance. Each segment has overhead — the header information takes up space. If segments are too small, you waste bandwidth on headers. If segments are too large, they are more likely to get damaged or lost during transmission, which means they have to be sent again. Networks use a standard called the Maximum Transmission Unit (MTU) to set a limit on how large a segment can be.
Most networks set the MTU to 1500 bytes, which means a segment can carry about 1460 bytes of actual data after the headers are added. Your computer and the receiving computer negotiate this size when they start communicating. If a segment is larger than the MTU, the network layer has to break it into smaller pieces, which adds extra work. This is why network administrators sometimes adjust MTU settings when they are trying to improve performance on a slow or congested network.
Frequently Asked Questions
Is a segment the same thing as a datagram?
No. A datagram is the term used for UDP segments specifically, while segment is the general term for the transport layer PDU. Some people use datagram and segment interchangeably when talking about UDP, but segment is the correct term for both TCP and UDP at the transport layer.
Can I see segments on my computer?
Yes, with a packet capture tool like Wireshark. These tools let you watch segments being sent and received in real time, and you can read the header information including port numbers, sequence numbers, and flags. This is useful for troubleshooting network problems or learning how specific applications communicate.
What happens if a segment gets corrupted during transmission?
TCP detects corruption using a checksum in the segment header and asks the sending computer to resend it. UDP also has a checksum, but it just discards corrupted segments without asking for a replacement. This is another reason TCP is used for data that must arrive intact.
Do all segments have the same size?
No. Segments can vary in size up to the MTU limit, which is usually 1500 bytes. The last segment in a message is often smaller than the others because it only contains whatever data is left. Your computer chooses segment sizes based on how much data needs to be sent and network conditions.
Why do segments need sequence numbers?
Segments can arrive out of order because they take different paths through the network. Sequence numbers let the receiving computer put them back in the correct order and detect if any are missing. UDP segments have sequence numbers too, but UDP does not use them to request retransmission like TCP does.