CS: Computer Networks: TCP, UDP, and the OSI Model
Comparing transport protocols and understanding layered network design
CS: Computer Networks: TCP, UDP, and the OSI Model
Comparing transport protocols and understanding layered network design
CS - Grade 9-12
- 1
List the seven layers of the OSI model in order from Layer 1 to Layer 7.
A common memory aid is: Please Do Not Throw Sausage Pizza Away.
The seven OSI layers from Layer 1 to Layer 7 are Physical, Data Link, Network, Transport, Session, Presentation, and Application. - 2
A web browser requests a webpage using HTTPS. Which OSI layer is most directly associated with the web browser's request, and why?
The request is most directly associated with the Application layer because HTTPS is an application-level protocol used by web browsers and web servers to exchange web data. - 3
Explain one major difference between TCP and UDP.
Think about whether the protocol checks that every packet arrived.
TCP is connection-oriented and provides reliable delivery by checking that data arrives and retransmitting missing data. UDP is connectionless and does not guarantee delivery, which makes it faster but less reliable. - 4
A video call app needs low delay and can tolerate a small amount of lost data. Should it use TCP or UDP for the live audio and video stream? Explain your choice.
The app should use UDP for the live audio and video stream because low delay is more important than perfect reliability. A small amount of packet loss may cause a brief glitch, but waiting for retransmissions could make the call feel laggy. - 5
A file download must arrive exactly the same as it was sent, with no missing bytes. Should it use TCP or UDP? Explain your choice.
Think about what could happen if one packet from a file never arrived.
The file download should use TCP because TCP provides reliable delivery, ordered data, and retransmission of missing segments. This helps make sure the downloaded file matches the original file. - 6
Match each item to the most appropriate OSI layer: Ethernet frame, IP address, TCP port number, and electrical signal on a cable.
An Ethernet frame belongs to the Data Link layer. An IP address belongs to the Network layer. A TCP port number belongs to the Transport layer. An electrical signal on a cable belongs to the Physical layer. - 7
A device uses a MAC address to deliver data on the same local network. Which OSI layer is responsible for this type of addressing?
MAC addresses are used before data leaves the local network.
The Data Link layer is responsible for MAC addressing because MAC addresses are used to deliver frames between devices on the same local network. - 8
Describe what happens during a TCP three-way handshake. Include the terms SYN, SYN-ACK, and ACK.
The handshake has three messages: request, reply, and final confirmation.
During a TCP three-way handshake, the client sends a SYN message to request a connection. The server replies with a SYN-ACK message to accept and acknowledge the request. The client then sends an ACK message to confirm, and the connection is established. - 9
A student says, "UDP is always worse than TCP because it is unreliable." Explain why this statement is not fully correct.
The statement is not fully correct because UDP can be better for applications that need speed and low delay more than guaranteed delivery. For example, online games, live video, and voice calls often use UDP because waiting for retransmissions can hurt real-time performance. - 10
An IP packet travels from your computer to a server across several routers. Which OSI layer is mainly responsible for choosing the path between networks?
Routers mainly operate at the layer that uses IP addresses.
The Network layer is mainly responsible for routing packets between networks. IP works at this layer and uses addresses to help routers forward packets toward the destination. - 11
Explain the purpose of port numbers in TCP and UDP communication.
Port numbers identify which application or service should receive the data on a device. For example, an IP address can identify a computer, while a port number helps identify a specific service such as web traffic, email, or a game server. - 12
A message is created in an application, then passed down through the OSI layers before being sent over the network. Explain what encapsulation means in this process.
Think about wrapping data in multiple layers of information before sending it.
Encapsulation means that each layer adds its own control information, such as headers, to the data before passing it to the next lower layer. This helps each layer perform its job, such as addressing, routing, or reliable delivery.