# <center><i class="fa fa-edit"></i> Network Fundamentals: Transport Layer Protocols </center>
###### tags: `Internship`
:::info
**Goal:**
To gain a basic understanding of the components behind network technologies. Focus on vocabulary and systems overview.
- [x] Transport Layer Protocols
**Resources:**
[Juniper Online Learning Modules](https://learningportal.juniper.net/juniper/user_activity_info.aspx?id=769)
[Pre-Internship Notes by Jessica Chen](https://hackmd.io/@j-chen/SyfRATOmD)
[Daily Report by Lin Yen-Ting](https://hackmd.io/@8KbRc796SnuYA2Dvsvk_BA/SJU_CawIL)
:::
## Module 6: Transport Layer Protocols
### Overview
- Enable application-to-application communication
- User Datagram Protocol (UDP)
- Transmission Control Protocol (TCP)
- Both are software ports that help route data to the correct application program
### Software Ports, Hardware Ports, and IP Interfaces
- Software Ports
- Specific to the Transport Layer
- Used to route data to correct application program
- Hardware Ports (NICs)
- Only exist at Layer 1
- IP Interfaces
- Exist at Layer 3

### UDP and TCP Software Port Numbers
- Port Field: 16-bits, allows port numbers ranging from 0~65,535

- UDP and TCP software port numbers
- Port 0 and Well-known Ports

- Registered Ports

- Dynamic or Private Ports

### Data Multiplexing
- Three different types of data from different application layer protocols arrive at Transport Layer and is multiplexed into a single stream down the IP interface
- Transport Layer Protocol adds header to Application Layer data that includes a soruce and destination port number
- Source Port Number: Randomly selected; uniquely identifies the connection on sending side
- Network Layer (IP interface) adds source and destination IP addresses and sends packet
- Data Link Layer adds Layer 2 framing info and transmits the data
- Each grame has a different Application Layer Protocol
- Process is reversed on the receiving device
-
### UDP Protocol
- Simplest and fastest Transport Layer Protocol
- UDP header

- Source Port

- Destination Port

- UDP Message Length

- UDP Checksum (Optional)

- Features
- Provides limited error checking capabilities and no recovery meachanisms due to optional checksum
- Interact almost directly with IP in Network Layer
- Like dropping your letter and hoping for the best
- UDP Application Layer Protocols: Applications for which speed > reliability use UDP
- Trivial File Transfew Protocol (TFTP)

- Domain Name System (DNS)

- Simple Network Management Protocol (SNMP)

- UDP is a connectionless service (can send datagram without prior notification or setup procedures)
- UDP is unreliable
- No guarantee that the datagram will be delivered to destination computer
- Sending computer has no way of knowing if info has arrived
- UDP transmits as fast as it can because there is no method of communication for the receiving computer to inform the sending computer to slow down
- Benefits of UDP
- Speed
- Efficiency at the cost of guaranteed delivery
- Translates user friendly computer hostnames into IP addresses
- DNS
- Used when a computer needs to translate or resolve a domain/host name to an IP address
- Steps
- UDP adds a header (the message and DNS port number, 53)
- UDP includes a source port number to which all replies should be sent
- UDP sends datagram to Network Layer
- IP packet is encapsulate in appropriate Layer 2 grame and transmitted to DNS server and completes the translation

- DNS Server (aka Name Server): Searches its database for requested name and sends back a response including the requested domain name and IP address
- Phone book of the Internet
- DNS Application on sending computer waits for a reply from the server
- No reply: tries again or sends query to a different DNS Server