Network 1
Network 1
Data communication
- = exchange of data between 2 devices via some form of transmission medium e.g. wire cable
- 4 fundamental characteristics for effective data communications system
- Delivery: system must deliver data to the correct destination; data must be received by the intended user and only by the user
- Accuracy: system must deliver data accurately; data that have been altered in transmission and left uncorrected are unusable
- Timeliness: system must deliver data in a timely manner; data delivered late are useless
- Jitter = variation in the packet arrival time
- Components in data communications

- Message = information (data) to be communicated
- Sender = device that sends the message
- Receiver = device that receives the message
- Transmission medium = physical path by which a message travels from sender to receiver
- Protocol = a common set of rules and format that govern data communications
- Governs how data is transmitted, received, and interpreted by both sender and receiver ⇒ thus LANs need communication protocols
- Ensures both sender and receiver can understand the message content and communicate with each other
- Defines how data is formatted and organised during transmission and specify how devices initiate, maintain, and terminate communication
- Handle how errors are detected and corrected during transmission
- Represents an agreement between the communicating devices
- Without a protocol, 2 devices may be connected but not able to communicate (e.g. 2 people speaking with diff languages)
Network
- = 2 or more computers/devices that are connected together for the purpose of communication
- Stand-alone = a computer/device that is not connected to a network
- A device can be a
- Host: e.g. laptop, cellular phone
- Connecting device: e.g. router, switch
- Advantages of using networks
- File sharing: users share files with other users
- Hardware sharing: share hardware e.g. printer
- Communication: users can communicate via email, chat or video
- Roaming access: users can sign in to any computer on the network and be able to access their files
- Centralized maintenance and updates: apply software updates across a network
- Centralized security: implementation of anti-virus software and firewalls to protect files from risks
- User monitoring: monitor what users do on a network
- Different access level for users: diff users can be given diff access rights
- E.g. restrict user access to certain files
- Disadvantages of using networks
- Cost: additional equipment needed to allow computers to communicate
- Additional resources to manage network
- Easy spread of malware (e.g. viruses) across an improperly secured network
- Hacking: with connected devices, data may be accessed without device owner’s permission
Network types
- Local Area Network (LAN)
- Network is geographically confined to 1 building or site
- E.g. Networks employed by schools and homes
- Wide Area Network (WAN)
- Network is spread over a wide geographical area
- Can cover >1 site, or be spread across a country, or even the world
- Internetwork / internet
- When 2 or more networks (LAN or WAN) are connected, they make an internetwork (a private internet) or internet (NOTE: lowercase i)
- Internet
- The Internet is the global system of interconnected computer networks that uses the Internet protocol suite (TCP/IP) to communicate between networks and devices
- It is a network of networks that consists of private, public, academic, business, and government networks of local to global scope, linked by a broad array of electronic, wireless, and optical networking technologies
- E.g. ISP is internet, not intranet
- Can be accessed at home
- What is the Internet?
- Intranet
- A private computer network used within an organisation to facilitate internal communication, collaboration, and access to company resources
- Is restricted to authorized users within the organisation
Open System Interconnection (OSI) Reference Model
- Provides a common basis for coordination of standards development for the purpose of systems interconnection
- 7 layers reference model that defines and separates networking hardware and software into distinct layers and functions
- Developed by International Organization for Standardization (ISO)
- An independent, non-governmental, international standard development organization composed of representatives from national standards organizations of member countries
- Attempts to standardize and define items that inc. communication and compatibility in many diff countries
| Layer | Protocol data unit (PDU) | Function | |
|---|---|---|---|
| Host layers (end devices, hosts, servers, computers) | Application | Data | Interfaces directly with end-user applications, providing network services e.g. email, file transfer, web access |
| Presentation | Translates data formats between systems; handles encryption, compression, and encoding | ||
| Session | Establishes, manages, and terminates sessions between applications | ||
| Transport | Segment / Datagram | Provides end-to-end communication, error recovery, and flow control | |
| Media layers (network devices, routers, switches, Network Interface Card (NIC)) | Network | Packet | Manages routing of data packets between devices across diff networks |
| Data link | Frame | Ensures reliable data transfer across the physical link; handles framing, error detection, and MAC addressing | |
| Physical | Bits | Transmission and reception of bitstream over a transmission (physical) medium |
Responsibilities of each layer
- Each layer in OSI model provides services to the layer above it while shielding the upper level from what happens below → higher layers do not need to know how the data got there or what happened at the lower layer
- Physical layer
- Coordinates functions required to carry a bit stream over a physical medium
- Deals with mechanical and electrical specifications of the interface and transmission media
- Defines procedures and functions that physical devices and interfaces have to perform for transmission to occur
- Physical characteristics of interfaces and media
- Defines the physical characteristics of the interface between the devices and the transmission media
- Also defines type of transmission / physical media
- Wired Transmission
- Twisted Pair Cable: used in Ethernet LANS
- E.g. Cat5, Cat6 cables

- To transmit data signals
- Copper cable used for networking purposes
- Pair of insulated wires twisted together to reduce interference and crosstalk

- Coaxial Cable: used in cable TV, older networks
- Electric cable consisting of a central conductor, an insulating layer, a metal shield, and an outer insulating layer

- Design allows for efficient transmission of high frequency signals over long distances with minimal interference

- Fiber Optic Cable: uses light to transmit data at very high speed over long distance with minimal interference
- Network cable that transmits data as light pulses through thins trends of glass or plastic, offering high bandwidth and faster speed (vs traditional copper cables)
- Used in telecommunications and internet connections for long-distance data transmission
- Wireless Transmission
- Radio Waves: used in Wi-Fi and mobile networks
- Type of electromagnetic radiation: long wavelengths and low frequencies within the electromagnetic spectrum
- Transmit information wirelessly over long distances by modulating their amplitude or frequency
- Uses:
- Audio and video signals
- E.g. radio and television broadcasting
- Voice and data communication
- E.g. mobile phones
- Wireless networking (Wi-Fi)
- Communication between satellites
- Microwaves: used in satellite and long-distance communications
- Infrared: used in short-range communication (TV remotes)
- Representation of bits
- Physical layer data consists of a stream of bits (sequence of 0s or 1s) with no interpretation
- To be transmitted, bits must be encoded into signals – electrical or optical

- Analog signals: continuous waveforms that represent data as a continuously varying voltage, current, or electromagnetic field
- Used to transmit information over various media (e.g. telephone lines, radio waves)
- Digital signals: use discrete voltages (e.g. 0V for 0 and 5V for 1)
- Defines the type of encoding (how 0s and 1s are changed to signals)
- Data rate
- Physical layer defines transmission rate (no. of bits sent each second)
- I.e. duration of a bit (how long it lasts)
- Synchronization of bits
- Sender and receiver must use the same bit rate and must be synchronized at the bit level
- I.e. sender and receiver clocks must be synchronized to prevent data loss or corruption
- Line configuration
- Physical layer is concerned with the connection of devices to the media
- Point-to-point configuration: provides a dedicated link between 2 devices. The entire capacity of the link is reserved for transmission between those 2 devices

- Multipoint / multidrop configuration: >2 devices share a single link
- In a multipoint environment, the capacity of the channel is shared by several devices, either spatially or temporally
- Spatially shared connection: several devices can use the link simultaneously
- Timeshared connection: users must take turns

- Physical topology
- Defines how devices are connected to make a network
- Topology of a network = geometric representation of the relationship of all the links and linking devices (nodes) to one another
- 4 basic topologies
- Mesh Topology

- Each device/node has a dedicated point-to-point link to every other device
- Each device/node is connected to n-1 devices/nodes in a fully connected mesh network with n nodes
- Star Topology

- Each device/node has a dedicated point-to-point link to the central controller
- Devices are not directly linked to one another and does not allow direct traffic between devices
- Bus Topology
- A multipoint connection
- A long cable acts as a backbone to link all devices in a network
- Devices are connected to bus cable by drop lines and taps

- Ring Topology
- Each device has a dedicated point-to-point connection with 2 other devices on either side of it
- A signal is passed along the ring in 1 direction, from device to device, until it reaches its destination
- Repeater regenerates the bits and pass them along

- Transmission mode
- Defines direction of transmission between 2 devices
- Simplex mode
- Communication is unidirectional
- Only 1 of the 2 devices on a link can transmit; the other can only receive
- E.g. keyboards and monitors

- Half-duplex mode
- Each device can both transmit & receive, but not at the same time
- When 1 device is sending, the other can only receive, & vice versa
- E.g. walkie-talkies

- Full-duplex mode
- Both stations can transmit and receive simultaneously
- Signals going in 1 direction share the capacity of the link with signals going in the other direction
- E.g. telephone network: both can talk and listen at the same time

- Data link layer
- Responsible for enabling direct communication between 2 devices on the same local network, oversees the delivery of the packet between the 2 devices
- Packages data into frames (framing), handles error detection, and controls how devices access the physical medium
- Physical addressing
- If frames are to be distributed to diff systems on the network, data link layer adds a header to the frame to define the sender and/or receiver of the frame
- If frame is intended for a system outside the sender’s network, receiver address is the address of the connecting device that connects the network to the next one
- Organises data into frames, each frame includes:
- Header with MAC address of source and destination
- Payload (actual data)
- Trailer with error-checking information
- Flow control
- Regulates rate of data transmission
- If rate at which data is absorbed by receiver is less than rate produced at sender: data link layer imposes a flow control mechanism to prevent overwhelming the receiver (overloading receive)
- Error control
- Data link layer adds reliability to the physical layer by adding mechanisms to detect and retransmit damaged or lost frames
- Also uses a mechanism to recognise duplicate frames
- Achieved through a trailer added to end of frame
- Error detection methods:
- Parity bits: simple checks to detect single-bit errors
- Checksums: summing values to detect corrupted data
- Cyclic Redundancy Check (CRC): technique to detect errors caused by noise or interference
- If error is found, frame is typically discarded, and higher layers may request a transmission, or error corrected using acknowledgement
- Access control
- When 2 or more devices are connected to the same link, data link layer protocols determine which device has control over the link at any given time
- Uses Media Access Control (MAC) protocol to avoid collisions (i.e. make sure no one else is using the line):
- Carrier Sense Multiple Access with Collision detection (CSMA/CD)
- Used in wired Ethernet (older systems)
- Devices listen before transmitting and detect collisions
- Carrier Sense Multiple Access w Collision Avoidance (CSMA/CA)
- Used in wireless networks
- Devices avoid collisions by waiting for a clear signal before sending data
- Data Link Layer usually split into 2 sublayers:
- Logical Link Control (LLC)
- Provide interface with network layer (upper layer)
- Handle error checking and flow control
- Media Access Control (MAC)
- Handles channel access (e.g. CSMA/CD, CSMA/CA)
- Physical addressing for various protocols (Ethernet, Wi-Fi)
- Ethernet and Wi-Fi include both MAC and LLC functionality
- Protocols

- Ethernet Frame
- Using e.g.
1 - Green fields: Ethernet header
- Preamble: this is a 7-byte pattern of 1s and 0s and is used for synchronization
- Start frame delimiter (SFD): marks the end of the preamble and tells receiver that the next fields will be the actual Ethernet frame, starting with the destination field
- Destination: destination MAC address of receiver
- Source: source MAC address of the device that sent the frame
- Type: what is carried inside the Ethernet frame (e.g. IPv4, IPv6 packet)
- Data: actual data that we are trying to transmit (e.g. IPv4 packet)
- Frame check sequence (FCS): helps receiver figure out if frame is correct or corrupt
- Media Access Control (MAC) address
- Physical address, unique for each network device
- A 48-bit (6-byte) hardware access
- Usually written in hexadecimal and divided into 6 groups of 2 hex digits, separated by:
- Colons (:); e.g. 00:1A:2B:3C:4D:5E
- Hyphens (-); e.g. 00-1A-2B-3C-4D-5E
- No separators, e.g. 001A2B3C4D5E
- 1st 3 bytes (00:1A:2B) ⇒ Organizationally Unique Identifier (OUI) identifies the manufacturer
- Last 3 bytes (3C:4D:5E) ⇒ Device-specific identifier, assigned by manufacturer
- Hardcoded into Network Interface Card (NIC)
- Used in Ethernet and Wi-Fi for local addressing (within same network / LAN)
- When a device sends an Ethernet frame, it will add its own MAC address as the source and the receiver MAC address as the destination
- Network Layer
- Responsible for source-to-destination delivery of a packet, possibly across multiple networks
- VS data link layer: oversees delivery of packet between 2 systems on the same network
- Ensures that each packet gets from its point of origin to the final destination
- Does not recognise any relationship between the packets
- Treats each one independently, as though each piece belonged to a separate message
- Needed if 2 systems are attached to diff networks with connecting devices (routers) between the networks
- Logical addressing
- If a packet passes the network boundary, network layer adds a header to the packet coming from the upper layer2 that includes the logical addresses3 of the sender and receiver
- Logical address helps distinguish source and destination systems
- Routing
- When independent network or links are connected together to create internetworks (network of networks) or a large network, the connecting devices (i.e. routers / switches) route / switch the packets to their final destination ⇒ network layer provides this mechanism
- Transport layer
- Responsible for process-to-process delivery of the entire message
- Process = an application program running on the host
- Ensures the whole message arrives intact and in order, overseeing both error control and flow control at the source-to-destination level
- Service-point addressing
- Computers often run several programs at the same time
- ⇒ source-to-destination delivery is not only from one computer to the next, but also from a specific process (running program) on one computer to a specific process (running program) on another
- Transport layer header must include a service-point / port address
- Network layer gets each packet to the correct computer; transport layer gets entire message to the correct process on that computer
- Segmentation and reassembly
- Message is divided into transmittable segments
- Each segment contains a sequence number that enable transport layer to reassembly message correctly upon arriving at the destination and to identify and replace packets that were lost in transmission
- Connection control (see Networks 3)
- Connectionless transport layer (User Datagram Protocol [UDP]):
- (No prior connection setup)
- Treats each segment as an independent packet
- Delivers it to the transport layer at the destination machine
- Connection-oriented transport layer (Transmission Control Protocol [TCP]):
- Makes a connection (i.e. establish a session) with the transport layer at the destination machine first
- Then delivers packets → ensures all data arrives in sequence
- Terminates connection after all data transferred
- Flow control
- Performed end to end at this layer, not across a single link
- Error control
- Performed process-to-process at this layer, not across a single link
- The sending transport layer makes sure that the entire message arrives at receiving transport layer without error (damage, loss, or duplication)
- Error correction usually achieved through retransmission
- Session layer
- Provides ability to the presentation entities to organise the communication for multiple communication sessions taking place at the same time
- Session initiation and teardown
- Session layer starts sessions between the communicating entities
- When session is over, session layer releases the communication
- Data transfer takes place in between
- Token management
- Related to communication mode used in the specific session (simplex, half-duplex, or full-duplex)
- Session layer controls which entity own the token and can transmit data at this time
- Token = license to transmit in an environment or service where only 1 entity can transmit at a time ⇒ not true for all applications: some operate in full-duplex mode or half-duplex mode
- Session-connection to transport-connection mapping (in connection-oriented transfer only)
- Allows session layer to map between the transport layer connections and the sessions currently taking place
- So the session layer can tell which data goes to what session
- Presentation layer
- Responsible for the way data is presented to the application
- At the start of communication: presentation layer negotiates the form of data to be transferred with the other entity, the transfer syntax
- After this negotiation: presentation layer can provide additional service(s) e.g. compression, encryption, translation → choice is up to application itself
- Application layer
- Defining the services presented at the user-end
- Identification of services provided to user
- Defining QoS 45parameters required for the application
- Defining security mechanisms to be employed – access control, authentication6
- Synchronization of communication applications (connection-oriented services)
OSI Model
- Describes how data is wrapped with headers / trailers as it moves down the OSI layers (encapsulation) and unwrapped as it moves up the layers (decapsulation) during transmission and reception
- Data encapsulation
- Flow of data from application layer to physical layer
- Header and trailer information is added to data in various layers at end7 and start of data

- Data decapsulation

- End-to-end data flow: walks through how data is prepared, sent, routed, and received using OSI model – from Host A to Router(s) to Host B
- Host A Source
- Transmission starts from application layer at Host A. Application decides that it needs to communicate with Host B and passes the data down to presentation layer
- Presentation layer does the required transformations that need to be done on data (e.g. compression, encryption, translation). Data is then passed down to session layer
- Session layer starts initiating the communication session and passes data to transport layer
- At transport layer, data is segmented and a header is added to each segment of the data
- This header contains transport control information e.g. sequence number and acknowledgement number
- The segment and its header are passed down to the network layer
- The header added by the transport layer is meant to be read by the transport layer at the receiving end
- Network layer deals with the whole segment (including its header) as data
- Network layer does not read segment header, but instead, handles the segment and its header as a single data element
- The data is then put into packets and headers are added to these packets
- Network layer header containsinformation meant to reach the network layer on the other end, info including a source and destination network-layer address along with few other parameters
- These packets are sent down to data-link layer
- Data-link layer handles the packet and its header as a single element, such that the network layer header is considered part of the data
- Data-link layer puts data into frames and adds a header and a trailer to each frame (e.g. Ethernet frame)
- Data-link header contains control informations sent to data-link layer on the other end; trailer usually contains error control information
- Frames are sent down to physical layer where they are dealt with as raw bits, which are transferred through physical channel to the router
- Router
- Router does a partial decapsulation
- No need to read data all the way up to its application-layer shape
- Router only needs to read up to network layer header to route the data to the destination
- Process starts at physical layer: data received as raw bits, which are then gathered into frames and sent over to the data-link layer
- Data-link layer reads header and trailer to know what to do with data
- Data-link layer then rips off header and trailer and sends the rest of data as a packet to the network layer
- At network layer, network header is read to determine destination network address, so router can choose best route to send data to destination host
- Starting from network layer, encapsulation starts again at the router
- Data goes down the data-link and physical layers and all the way through the physical link to the destination host
- If there is another router in the way, the same process that took place in the first router is repeated until reaching the destination host
- Host B Destination
- At destination host, raw bits are elevated as frames to the data-link layer
- Header and trailer of each frame are read by data-link layer then removed
- The rest of the data is elevated to the network layer as packets
- Header of packet is read to determine if this is the correct destination for the packet and other network control information is also taken from network layer header. Header is then removed and the rest of the data is elevated to the transport layer as segments
- Header of each segment is read to determine sequence number and arrange segments in their correct order
- Header is then also removed and rest of data is elevated to session layer
- Transport header also contains info of which session this data is going to
- This info is passed to the session layer with the data
- Session layer determines if this is the end of this session or not
- If it is last segment in session: session layer will wait for the request to end this session
- Else: session layer waits for more data
- Data is then passed to presentation layer to retransform data into shape that they were sent in by the sending-end application or to another form determined by the application
- Might involve decompression, decryption, or translation
- Data is then transferred to the application and received by user
Comments from the Word document
Footnotes
-
Comment by ANDREA TAN KAI XUAN HCI: other than 7, what are the numbers for ↩
-
Comment by ANDREA TAN KAI XUAN HCI: ? ↩
-
Comment by ANDREA TAN KAI XUAN HCI: E.g. IP address? ↩
-
Comment by ANDREA TAN KAI XUAN HCI: ? ↩
-
Comment by ANDREA TAN KAI XUAN HCI: From google ai overview: QoS (Quality of Service) parameters are metrics used to measure and manage the performance of a network service. ↩
-
Comment by ANDREA TAN KAI XUAN HCI: Note from google ai overview: Authentication verifies who a user is, while authorization determines what a user can access or do ↩
-
Comment by ANDREA TAN KAI XUAN HCI: why is header added to end, not start of data ↩