network layers
Summary
Building the packet
| Layer | Packet format | Needs |
|---|---|---|
| application layer | message | the data itself |
| transport layer | segment -> src & dest ports | message | which port/process to send to |
| network layer | datagram -> src & dest ip | segment | which host to send to |
each successive layer builds upon the packet
Concept
Protocols
- format and order of messages exchanged
- actions taken upon receiving/sending
Protocol layers
- built upon layers of abstraction, upper layers do not need to deal with the physical connection directly
- all communication still goes through the physical layer

Application layer
- application to application
- protocols used by internet applications running on hosts
- HTTP, DNS, FTP, SMTP
| Architecture | Desc |
|---|---|
| client-server | - server: listens and waits, provides a service - client: initiates contact |
| peer to peer(P2P) | - end hosts communicate directly - scalable: new users add more capacity - difficult to manage |
| hybrid | - central server helps to link end hosts |
| Requirements |
- data integrity: file transfer requires lossless; streaming can tolerate data loss
- timing: games need low latency
- throughput: multimedia requires minimum amount of bandwidth to be effective
- security: encryption, authentication
Transport layer
| Stakeholder | Role |
|---|---|
| sender | break message into segments |
| receiver | reassemble segment into messages |
| routers | inspect dest ip and route |
ususally, routers are in the network layer
Network layer
- host to host
- best-effort and unreliable
- DHCP
Extra
Tikz template for protocol diagrams