【Lecture10】Computer Systems & Networks
The Network Layer (OSI Model)

- Application Layer: Defines what message to send
- Presentation Layer: Defines the format of the message
- Session Layer: Defines when messages can be sent
- Transport Layer: Sends entire message across network
- Network Layer: Sends a data packet across network
- Data Link Layer: Sends a data packet to (from) connected devices
- The Physical Layer: Sends individual bits to (from) connected devices
The Physical Layer
The physical layer is responsible for ensuring that a stream of bits are transmitted between two nodes sharing a single link
The Data Link Layer
The data link layer is responsible for ensuring that a packet of data is successfully transmitted between two adjacent nodes in the network.
The Network Layer
The network layer is responsible for getting an individual packet of data from the source computer to the destination computer.
The Transport Layer
The transport layer is responsible for getting the entire message from the source process to the destination process reliably.
The Session Layer
The session layer allows two communicating processes to co-ordinate the exchange of data. (Thisestablishes,maintainsandsynchronisesthe interaction between two communicating processes.)
The Presentation Layer
The presentation layer formats the data for interoperability, security and efficiency of transmission.
The Application Layer
The application layer is the interface between the user and the network.
Parallel and Serial Transmission
Stop-and-wait Implementation
Implicit Retransmission based on ACKs
- The receiver returns ACKs for each error-free packet received.
- Each time the sender gets an ACK it transmits another packet and starts a timer.
- If the sender does not receive an ACK within a set time interval (the timeout interval), it retransmits the packet.
Explicit Request based on NAKs.
- Improves link utilisation by allowing the receiver to send NAKs
- Avoids the sender having to wait for timeouts before resending.
- However, the sender still has a timer in case the NAK or ACK are lost during transmission.
- In order for the receiver to discriminate between the next valid packet ( as it expects ) and a resent one, each packet transmitted must contain a unique identifier known as the sequence number ( N, N+1 etc, )
Stop-and-Wait Implicit Retransmit

Stop-and-Wait Explicit Request

How to differentiate classA, classB, and ClassC

- ClassA: 0~126 (First Octet)
- ClassB: 128~191 (First Octet)
- ClassC: 192~223 (First Octet)
How many hose IDs can you get?
Example
subnet mask: 255.255.254.0 (11111111.1111111.11111110.00000000)
This means there’s 2 to the power of 9 amount of host ids. Which is 512. However, All 0 and All 1 are 2 special host addresses. That’s is why the available host IDs would be 510.
Consequently, the total number of host IDs would be 510*128 (65280).