# Data Multiplexing, UDP Protocol, and UDP Protocol Features ###### tags: `elearning` `Multimedia Wireless Network` ###### Note Page : [:link:](https://hackmd.io/@YTL0307/HJEb6jWCo) --- [TOC] --- ## **Data Multiplexing** - How the Transport Layer multiplexes data. - Three different types of data are coming from different application layer protocols. ![](https://i.imgur.com/Pk0N7Q6.png) - The three different types of data arrive at the Transport Layer, which multiplexes, or combines all the different types of data into a single stream, down to the IP interface. - At the Transport Layer, a protocol like UDP or TCP adds a header to Application Layer data that includes a source and destination port number (show the destination port number only). ![](https://i.imgur.com/8u9TYY9.png) - The source port number is a randomly selected number that uniquely identifies the connection on the sending side. - The Transport Layer protocol then sends this segment or datagram down to the Network Layer. - At the Network Layer, the IP interface adds the source and destination IP addresses (show a shortened version of the destination IP address only). ![](https://i.imgur.com/upi3rkp.png) - The Network Layer then sends the packet to the Data Link Layer. - At the Data Link Layer, the Layer 2 framing information is added and the data is transmitted. ![](https://i.imgur.com/O237zpO.png) - The Transport Layer allows multiple Application Layer protocols to share a single IP interface or IP address. - At the physical layer, each of our frames is converted to an electrical signal and transmitted. ![](https://i.imgur.com/AHkfc0C.png) - Each of these frames is going to the same computer but ultimately each is going to a different Application Layer protocol. - On the receiving device. - The process is reversed... ![](https://i.imgur.com/38Bdv7B.png) - The Data Link Layer strips off the Layer 2 frame, sends the IP packet to the IP interface where the Layer 3 header is removed. ![](https://i.imgur.com/UQWkytz.png) ![](https://i.imgur.com/TX2xttP.png) - The Network Layer sends the datagram to the appropriate Transport Layer protocol, which examines the destination port number, removes the header, and sends the data to the correct Application Layer protocol. ![](https://i.imgur.com/PLp2ZLX.png) ![](https://i.imgur.com/Q1rUQZ0.png) ![](https://i.imgur.com/GozVIpo.png) - At this point, the single data stream is demultiplexed into multiple streams going to the appropriate Application Layer protocols. --- ## **UDP Protocol** - Two Transport Layer protocols used in the TCP/IP protocol suite, UDP and TCP. ![](https://i.imgur.com/Xg206tP.png) - UDP is the simplest and fastest Transport Layer protocol. - In fact, the specification for UDP is only three pages long! - Like we saw with IP, UDP also adds a header to the data. - The UDP header only includes 4 fields. - The UDP header: ![](https://i.imgur.com/ngXyd8r.png) - Source Port ![](https://i.imgur.com/Dctnb2U.png) - Destination Port ![](https://i.imgur.com/nsPI1GD.png) - UDP Message Length ![](https://i.imgur.com/Z8nqTNr.png) - UDP Checksum (Optional) ![](https://i.imgur.com/LPqbNAd.png) --- ## **UDP Protocol Features** ![](https://i.imgur.com/iYD9Hqy.png) - UDP is like dropping your letter in the mailbox and hoping for the best. - Because the header only contains a simple checksum, UDP provides limited error checking capabilities and no recovery mechanisms. - Even the checksum is optional. - In effect, aside from the multiplexing capabilities, applications using UDP interact almost directly with IP in the Network Layer. - Because the UDP header is only four fields, the header and data together are often referred to as a 'datagram' rather than a segment, hence the term "datagram" in "User Datagram Protocol". - After the Network Layer receives the datagram, it then adds an IP header to create a packet.