CSC1050 Week 02 Lecture 2
Textbook and Readings
- The textbook is available for sale and has a couple of copies in the library.
- The textbook mentioned is "Computer Networking: A Top-Down Approach".
- Online access is available via ProQuest through the university's easy proxy.
- Users can download up to 40 pages at a time as PDFs.
- There is a limit of three concurrent users for the online version. Access it through the reading list on the study desk.
- Earlier versions (e.g., version 7) of the textbook are acceptable; the content is the same, but end-of-chapter questions may differ.
Packet Switches and Network Issues
- The core of the internet contains packet switches, also known as switches or routers.
- Problems that can occur on a network include loss, delay, and throughput issues.
- The client-server model and the concept of sockets will be discussed.
- Sockets provide a programming interface for applications to communicate across the internet.
Protocols: HTTP and DNS
- The practical session will focus on the HTTP protocol.
- This lecture will cover HTTP and DNS protocols, their formatting, and usage.
Key Network Operations: Forwarding vs. Routing
- Terminology and concepts are key in this course, especially for the multiple-choice exam.
- Two core operations in the network are forwarding and routing.
Forwarding (Switching)
- Forwarding is a local action that occurs on a router or switch.
- A packet arrives at a router, which then forwards it out through another interface.
- Routers use a forwarding table to determine the output interface based on header values (e.g., address).
- Each device (router or switch) maintains a forwarding table.
- Example: If a header value is 0111, the packet is sent out link number 2.
Routing
- Routing is a global action that involves the entire network.
- It determines the end-to-end path a packet takes.
- Routing informs the local forwarding process. Routers aren't responsible for end-to-end delivery, just the next hop.
- Routing algorithms are used to generate a global view of the network.
- Network switches use a different mechanism for forwarding decisions.
- Routing ensures that each device in the path knows the next interface for packet forwarding.
- Key takeaway: Forwarding is local; routing is global.
Store and Forward
- Devices wait for an entire packet to be received before forwarding.
- Reason: To ensure the packet is intact and validated.
- Packets consist of bytes, which are streams of bits (electrical signals on an Ethernet cable).
- The entire packet must be received to avoid forwarding corrupted information.
- The process involves buffers (memory areas) where packets are read into before being written out.
Packet Transmission Delay
- Delay is induced due to store and forward.
- Packet transmission delay: The time it takes to fully transmit a packet.
- Faster links (higher bandwidth, e.g., gigabit) reduce packet transmission delay.
Queuing
- Queuing occurs when packets arrive faster than they can be processed.
- Packets are stored in memory buffers, creating a queue.
- Each device has a specific memory size allocated to these buffers.
- High-speed switches may have dedicated memory per interface, while older devices may share a memory pool.
Packet Loss
- Packet loss occurs when buffers run out of space.
- When a packet arrives and the buffer is full, the packet is dropped.
- Adding more memory isn't always the solution because larger queues increase delay.
- Memory allocation for buffers is a trade-off between preventing packet loss and minimizing delay.
- Most network links are not constantly running at full capacity (e.g., gigabit).
- ISPs sometimes oversubscribe network links.
- When devices are manufactured what the average throughput might be is considered, sizing the memory space appropriately to match their particular price point.
- Packet loss can be tolerated by many protocols, although it can slow things down.
- Extreme packet loss can degrade services, such as video streaming.
Packet Switching vs. Circuit Switching
- Packet switching: Individual packets are handled separately by forwarding devices.
- Dominant method used in modern networks.
- Circuit switching: An alternative where dedicated circuits are established end-to-end.
- Analogous to old-style telephone exchanges.
- Requires resource allocation end-to-end, which is impractical for the Internet but viable within single-organization networks or ISPs.
- Techniques used: Time Division Multiplexing (TDM) and Frequency Division Multiplexing (FDM).
- Example: Asynchronous Transfer Mode (ATM) was once used to build circuits for dedicated connections.
- Downside of circuit switching: Unused capacity when no data is being sent.
- Upside: Dedicated resources ensure no packet loss.
- Circuit switching has virtually disappeared due to the efficiency of packet switching.
Congestion and Packet Loss
- Packet loss can happen due to congestion (queue fills up) or corruption.
- Congestion is analogous to traffic jams on a road.
- Corruption can occur on Ethernet cables and WiFi due to electromagnetic interference, causing bits to flip.
- Corrupted packets are discarded, leading to packet loss.
Packet Retransmission
- Lost or corrupted packets can be retransmitted by the sending node.
- Some protocols handle retransmission, while others do not.
- Faulty interfaces can also send bad packets.
- Fiber optics are less susceptible to interference than WiFi but can still experience corruption.
- WiFi is highly susceptible to interference (e.g., microwave ovens, Bluetooth).
- Modern WiFi devices adapt to minimize interference.
- Starlink may perform better in rural areas due to backhaul capacity rather than inherent technology advantages.
- Certain radio wavelengths are affected by water (rain, fog).
Packet Delay
- Packet delay: The time it takes for a packet to travel from source to destination.
- Some delays are unavoidable due to the laws of physics.
- Different types of delay: nodal processing delay, transmission delay, propagation delay, and queuing delay.
- Ping times measure delay.
Nodal Processing Delay
- Occurs at each network device (switch, router) along the path.
- Includes error checking and determining the output interface.
- Modern devices use silicon chips for fast processing.
- Security measures (firewalls) can also add to the nodal processing delay.
- Even small delays accumulate over many hops (e.g., across the world).
- Underpowered devices handling high traffic may exhibit increased nodal delay.
Transmission Delay
- The time it takes to transmit a packet onto the wire or fiber.
- Depends on packet size and transmission speed of the link.
- Faster links (gigabit) have lower transmission delays.
Propagation Delay
- Signals travel at a fraction of the speed of light through fiber or wire.
- Longer distances result in greater propagation delay.
- Unaffected by speed of router. The packet has to travel from point A to B.
- Content Delivery Networks (CDNs) mitigate propagation delay by caching data closer to clients.
Queuing Delay
- Occurs when packets wait in a queue due to processing delays.
- Analogous to waiting in line at a coffee drive-through.
- Related to nodal processing delay: Slower processing leads to longer queues.
Traceroute
- A program used to measure round-trip delay and identify the path taken by packets.
- Sends three packets to each router in the path and measures the response time.
- Some routers may be configured not to respond, which can appear as packet loss.
Example Traceroute
- Traceroute output shows the series of routers a packet traverses.
- Delays increase when packets travel to distant locations (e.g., Sydney).
- Router names often indicate their location.
- Content Delivery Networks (e.g., Google) use points of presence around the world.
- The speed is affected due to the physical location of the server.
- Routers that are heavily loaded can exhibit higher round-trip times.
- Traceroute can help identify where delays occur.
- Networks are defined as devices under common management.
Throughput
- Throughput is the actual rate at which bits are sent through a network.
- Measured in bits per second.
- Tool commonly used to test this is Speedtest.net.
- Throughput is limited by the smallest link in the path (bottleneck).
- Network links can be oversubscribed when demand exceeds capacity.
Network Organization and Communication
- Networks are complex, with numerous devices connected together.
- How are packets managed from end to end? Analogy of air travel presented.
Layered Services Analogy (Air Travel)
- Ticketing service.
- Baggage service.
- Gates.
- Runway.
- Airplane routing.
- Process with the airline is broken down into different layers of services
Network Stack (TCP/IP Model)
- Application.
- Transport.
- Internet.
- Data Link.
- Physical.
- Layers provide independent services that rely on each other, allowing changes in one service to be transparent to others.
Responsibilities by Layer
- Application: Creating messages between applications (e.g., HTTP, DNS).
- Transport: End-to-end communication.
- Network: Routing between endpoints (IP protocol).
- Data Link: Local area network communication.
- Physical: Formatting bits on the network.
- Messages flow from application to transport, network, data link, and then the physical layer; the reverse occurs at the destination.
Encapsulation
- At each layer, data is encapsulated with headers and trailers.
- Application data enclosed in TCP, then IP, then Data Link layers.
- Each header and trailer has its own role in ensuring data transmits from source to destination (adding headers as required).
- De-encapsulation at each node.
- Adding headers to the application like putting labels and stamps on the document as it being sent (adding them as required).
Encapsulation Example: Source, Router, Destination
- Message from a source is encapsulated, travels through a router, and is de-capsulated at the destination.
- Routers are primarily involved with the network layer, using the IP header to determine the next hop.
- Local switch cares switch cares about the datalink layer for what local source it should be delivered to
- Once the address is found, the document can be received in its original form.
- Devices only need to read the headers they require to transmit the data onto its next journey.
- We don't always have to de encapsulate a packet; we only need to do what the device requires (reading headers).
Application Layer Protocols
- Protocols at the application layer facilitate communication between applications.
- Examples: DNS, HTTP, FTP, SMTP.
- No direct addressing.
- The other lower layers rely on the protocol to to deliver the resources.
- Applications rely on underlying layers for transport, focusing on message exchange.
Network Applications
- Run on end systems and communicate over the network.
- Example provided: Twitter, Facebook, etc.
- Rely on underlying layers to do end-to-end transport.
Client-Server Architecture
- Client-server is the most common architecture.
- Client initiates the connection, and the server responds.
- Servers are generally always on, with permanent addresses, and often located in data centers.
- Clients can connect to and leave networks, and use different addresses.
- Peer-to-peer networks lacks centralized service.
- Peers communicate directly to share resources.
- Problem is: How do you know which peer has the resources available and a way of tracking the information?
Network Communication
- Applications run processes.
- A program is a piece of software, that performs a certain task, while processes are running that program/task/software.
- Processes are allocated resources (memory, CPU time).
- When the program is run, the process is generated.
- Within the same computer we have a form of intercommunication.
- When a message is sent out, the data needs to have certain headers to deliver it from point A to point B.
- Client initiates the connection, while the server listens.
- The server waits to be contacted.
- Command netstat -na is used to show information about the current connections.
- Each of the processes is sitting there waiting for something to happen.
Sockets
- Processes send/receive messages via sockets.
- Sockets is the standard interface and access to the network, where your application runs.
- Treat the socket as a file for easy integration. It acts as a file descriptor.
- Your application only needs an appropriate library, providing socket commands.
- Your application does not need to implement different methods to read the file, it only needs to read the file in the standard way.
Multiple Services on a Computer
- The IP address isn't enough, we need an extra bit of information.
- Several processes use a socket by being assigned ports.
Application Layer Protocols
- Protocols define message types, message syntax (valid message content), message semantics (What does it mean), and rules for processing.
- The protocol can be open, or proprietary.
Transport Layer Choice
- Data Integrity.
- Time Sensitive.
- Tolerate packet loss.
- Efficient throughput.
- Security.
Reliable (TCP) vs Unreliable (UDP) Transport
- The Transport layer protocol depends on the requirements of your application.
- TCP = Guarantees that a message that is sent will be received.
- UDP = Doesn't have these features, so may need to use it at times where you choose losing data above reliability/guaranteeing reliability. Example, GPS (there's a time factor).
Benefits of UDP
- Less overhead.
- Faster speed.
- Smaller packets.
- Higher throughput.
Packet Loss, delay discussion and TCP/UDP will be discussed further another day (Wednesday).
HTTP: Hypertext Transfer Protocol
- Everyone uses HTTP (as of modern day).
- Many large responses compared to fewer, smaller responses.
- Request = small. Response = large.
- Transactional, meaning that once the server listens, than requests can be made.
- Otherwise the server will not send out anything.
- Statelessness, meaning that the network can forget certain states without any issues. In other words, the network cannot remember old states. (This has been overcomed).
- Permits negotiation of data type, where certain information is delivered based on the request.
Web Components
- HTML. Code set that formats the visual for the machine.
- Communicates with the internet. In HTTP, a component and language of what to do.
- URI - Uniform Resource Identifiers.
URI
- Protocol.
- Host Name.
- Port.
- File Name/Resource.
URL Example
- Protocol: HTTP can be seen at the start (Also can be HTTPS, where security is applied).
- Server Name:
- Port (optional): 80 HTTP, 443 HTTPS.
- ReSOurce Path/Filename
HTTP Versions:
- HTTP .9 (Wasn't called at that time, but named that at retrospect). Wrote by Tim Berner in 1991, the original vision for what to send. Only supported HTML.
- HTTP 1.0, generalized the application, uses all of the different media, with MIME (multipurpose internet mail Ext). Would be used for things like plain text/HTML, and image (JPEG or JPG).
- HTTP 1.1 Allowed support with HOSTNAME support. Persistent support connections, part resource selection, caching, using more connections than setting back down and building. Less networking overhead.
- HTTP 2 in 2015. Has Header compression (like zipping files), HTTP Pipelining requests. Designed to decrease latency time.
Version Three (Three QUIC)
- Uses both TCP UDP, which provides more resources for quick use.
HTTP Message Format:
- Both Request and Response share a common format, with the message header (containing red box around), black line, and message body optional.
- Request Message - request line, optional request headers, with the message body.
- Requeset Line = Method/Command, Space, URL or resource, space, version is running
HTTP Request Example:
A general example could be running a command through the current protocol, in which requires HTTP as an additional protocol.
Some methods can be executed via DELETE, Trace, Options.Connect = Way of doing 2 part communication, being symmetrical used for VPN to create tunnels and so on.