Computer Networks

BCS1110

Dr. Ashish Sai

🗓️ Week 4 - Lecture 1 & 2
💻 bcs1110.ashish.nl

Plan

  • Introduction to Networks
  • Understanding the Internet
  • Application and Services
  • Developing for the Web

Introduction to Networks

Part 1/4

Network Basics

  • Communication networks share data and information
  • Networks link things
  • Networks are classified in various ways
  • Control affects privacy and security

Shannon's Communication Model

  • Claude Shannon described a universal communication model in 1948
  • His diagram shows the essence of a network

Network Types: PAN

  • PAN (Personal Area Network) connects devices within 30 feet, wirelessly
  • Serves a single individual
  • Used for syncing data, wireless printing, etc.

Network Types: LAN

  • LAN (Local Area Network) connects PCs in a single building
  • Examples: School labs, home networks, Wi-Fi in public places

Network Types: WAN

  • WAN (Wide Area Network) covers large areas, consists of smaller networks
  • Examples: Internet, telephone systems, cable TV, satellite communication

Communication Channels

  • Communication channel: Medium for information transmission
    • Wired channels: Use wires and cables
    • Wireless channels: No cables or wires

Wired Communication Channels

  • Includes twisted pair wires, coaxial cables, Category 6 cables, fiber-optic cables

Security in Wired Channels

  • Wired connections are secure
  • Difficult to tap without physical access or special equipment

The Creepy, Long-Standing Practice of Undersea Cable Tapping

The newest NSA leaks reveal that governments are probing "the Internet's backbone." by The Atlantic

Pros & Cons of Wired Connections

  • Pros: Shielded, dependable, secure
  • Cons: Costly, limited mobility, easy to damage

Wireless Communication Channels

  • Uses radio signals, microwaves
  • RF (Radio frequency) signals sent by transceivers with antennas

Wireless Devices & Transceivers

  • Devices have transceivers for sending and receiving data
  • Includes an antenna

Microwaves in Communication

  • Microwaves are directional, high-capacity signals
  • Used for large corporate networks

Example: Starlink and GPS

Pros & Cons of Wireless Communication

  • Advantages: Mobility, no cables, less power spikes
  • Disadvantages: Speed, range, security, licensing

Bandwidth in Communication Channels

  • Bandwidth: Transmission capacity
  • Broadband: At least 25 Mbps (million bits each second)
  • Narrowband: Slower than 25 Mbps (million bits each second)

1 Mbps is 0.125 Megabytes/sec

SERVICE Recommended Download Recommended Upload
Zoom video calling and screen sharing 600 Kbps 600 Kbps
Zoom video calls (HD) 1.2 Mbps 1.2 Mbps
Zoom group calling 2 Mbps 2 Mbps
Netflix movie on a laptop computer 1 Mbps
Netflix SD movie on a TV 2 Mbps
Netflix 720p HD movie 4 Mbps
Netflix "best video and audio experience" 5 Mbps
YouTube basic videos 500 Kbps
YouTube movies, TV shows, and live events 1 Mbps
Amazon Prime Instant Video (SD) 900 Kbps
Amazon Prime Instant Video (HD) 3.5 Mbps
Netflix and Amazon Prime 4K Streaming Video 15-25 Mbps

Overview of Network Topology

Types of Network Topology

  • Topology: structure and layout of network components
    • Point-to-point: connects peripheral devices to a host
    • Star: connects devices to a central device
    • Mesh: connects devices to each other, full or partial
    • Bus: connects devices in a linear sequence

Network Topology Diagram

Introduction to Network Nodes

  • Node: any device on a network

    • DTE (Data Terminal Equipment): stores or generates data
    • DCE (Data Communication Equipment): controls data speed, signal conversion, error checking, and routing

Devices as Network Nodes

  • Router: controls data flow and acts as a gateway
  • Modem: converts signals for communication channels

Specialized Network Nodes

  • DCEs like routers, switches, and hubs extend home network range

Introduction to the Internet

Part 2/4

What is the Internet?

  • A global system of computers connected together
  • A network of networks!
  • Designed to be redundant - can reach a computer through multiple paths
    • Hierarchical - organized into ever smaller groups (like mail addresses)
    • Internet allows computers to send information (bytes) to each other

The Birth of the Internet

  • Started in 1957 in response to Sputnik
  • U.S. initiative led to ARPA
  • ARPANET in 1969 connected four universities

Evolution of Internet Usage

  • Early use: email, file transfer, scientific calculations
  • 1990s: user-friendly tools, public subscriptions
  • Today: 15,14 billion nodes, 5,19 billion users, over 330000000 Terabytes (or 0.33 Zettabytes) of daily data

Whenever you use a website, you are connected to a large network of computers on the internet

Client Server Network Model

Server: You can think of a Server as a power computer that can provide resources or services to one or more clients.

Client is a computing device (can be a phone or a supercomputer) that needs access to the resources of services provided by your server. The client is connected to a network of computers (your server should be connected to this network as well).

Most servers tend to have a one-to-many relationship with clients

Client-Server Model

Loading a Website

  • Client: Your computer
  • Server: Another computer at the URL (e.g. bcs1110.ashish.nl)
  • Request: Ask for a webpage (with a URL)
  • Process:
    1. Client asks the server for the information (request)
    2. Request is sent to the server through a sequence of routers
    3. Server decodes the request, sends back the information (response)
    4. Client interprets the response

Use traceroute to see the how your computer finds bcs1110

Reminder

  • What do we mean by the internet?
    • A network of networks
  • What do we mean by the internet?
    • It is a WAN in which all computers communicate using a standardized protocol known as IP.

Accessing Information: URLs

Understanding URLs

  • URL: Uniform Resource Locator
  • Protocol: Rules for the information (e.g., http)
  • Domain Name: Gets converted to an IP address via a Domain Name Server (DNS)
  • IP Address: Computer-readable (e.g., 142.250.179.142 for google.com)
    • Hierarchy: Each byte of the address gets more specific
    • Example: Try 145.20.124.148 (traceroute ou.nl)

Challenges of the Internet

  • Key Questions
    • How does the receiving computer interpret the response?
    • How to communicate across multiple operating systems?
    • How to ensure all information was transferred?
    • How to handle multiple requests and responses to the same router?
    • How do routers know where to send the information?

Standardized Protocols

  • A protocol specifies how the communication is handled by establishing a standardized vocabulary.
  • A protocol can usually specify two things:
    • Hardware details such as the frequency at which the data is transmitted
    • Software details such as the representation of an address (name) in the network

    TCP/IP is the protocol suite used for the Internet

TCP/IP Protocol

  • Rules for sending information between computers
  • Developed by the US Department of Defense, used by everyone
  1. Network Layer: Captures the physical aspects of data transmission such as the media used (wire/wireless) and the hardware related protocols.
  2. Internet Layer: Looks after the logical transmission of data. We define the logical address (IP) of our devices connected to the Internet in this layer.
  3. Transport Layer: This layer is responsible for end-to-end communication, specifically error-free transfer. Example: TCP and UDP protocols.
  4. Application Layer: This is where your server needs to define its networking preferences such as using SSL etc.

Application Layer

ARRIVAL PROTOCOLS

  • Facilitate data conversion and interpretation for specific applications

  • Define rules for data presentation (HTML/CSS), encryption, and session management (cookies 🍪)^

[^]: These are not the nice kind of cookies 😔

Application Layer Protocols (HTTP)

  • HTTP (Hypertext Transfer Protocol): Used for web browsing, defines how web browsers and servers communicate
    • 200s: all is good
    • 400s: client errors
    • 500s: server errors

Application Layer Protocols (SMTP)

  • SMTP (Simple Mail Transfer Protocol): Used for email transmission between mail servers
IMAP SMTP
Server outlook.office365.com smtp.office365.com
Port 993 587
Encryption method SSL (START)TLS
Authenthication method* OAuth2 OAuth2
Username e-mail address e-mail address
Password UM-password UM-password

Break

Do not leave your seats (5 Min)

Transport Layer

Transport Layer Protocols

  • Responsible for end-to-end communication and data integrity
  • Handle data segmentation, sequencing, error correction, and flow control
  • TCP (Transmission Control Protocol): Ensures reliable communication, confirms data receipt, retransmits lost data
  • UDP (User Datagram Protocol): Faster but less reliable, suitable for real-time applications like video streaming

Transmission Control Protocol (TCP)

  • Functionality:
    • Separates information into chunks (packets)
    • Sends and reassembles packets
    • Ensures information is complete and correct

Understanding Packets

  • Packet: data parcel sent across a network
  • TCP and UDP: core Internet protocols for data handling

Internet Layer

Internet Protocols: IP Addresses

  • Most computing networks are connected to the Internet. Thus, they adhere to the TCP/IP protocol (this includes your phone, laptop, and maybe even your cat litter tray 🤷🏻 )
  • Every device that is connected to the internet is assigned a unique 4-byte IP address:
    • E.g., www.ou.nl is 145.20.124.148^
    • If we pass the IP address to our router, it knows how to find the computer with that address.

[^]: This is an example of IPv4, there is a newer version of IP that has a different structure with 16-byte addresses.

Static and Dynamic IP

  • You get your IP address through the ISP when using the Internet.
  • Most devices do not always need internet services; thus, assigning a unique IP address to each device is wasteful.
Type Description
Static Your IP address does not change (useful for web servers - the OU address from last slide is an example of a static IP address)
Dynamic These IP addresses change frequently (your phone, laptop and other personal devices tend to have dynamic IP address)

Private and Public IP

  • At times it does not make sense to get an IP address from your ISP. For e.g., if you want to access a server (e.g., Maastricht University’s Gitlab, Canvas ) from the local area network of UM.
  • To simplify the IP address allocation and deallocation process, we have two classes of IP addresses: Public and Private IP addresses.
Type Description
Public This IP address is accessible from anywhere on the Internet
Private Private IP addresses are only valid within in a local network (household, campus etc)

If you Google your IP address, you are presented with your public addresses as web servers outside your local network (such as Google) do not know your private address.

Internet Addresses: Summary

  • Controlled by IP, static and dynamic addresses
  • IPv4 and IPv6 standards
  • Private IP addresses and public IP routing

Internet Protocol (IP)

  • IP Addresses
    • Format: XX.XX.XX.XX (each XX is a byte)
    • Hierarchy: First byte is large area, and so on
    • IPv6: Expanding to 6 bytes of addresses instead of 4
    • DNS: Includes Domain Name Servers to convert from domains to IP addresses

Domain Names and DNS

  • Domain name: easy-to-remember IP address
  • DNS: tracks domain names and IP addresses
  • Top-level domains: .edu, .org, etc.
  • DNS spoofing: unauthorized changes

DNS Spoofing

Network Layer

Network Layer

  • Define the physical connection between devices
  • Specify cable types, signal standards, and data rates
  • Ethernet: Standard for wired connections, using twisted-pair or coaxial cables
  • Wi-Fi: Standard for wireless connections, using radio frequency (RF) technology
  • Communication: Handles communication to/from router

Hardware for Computer Networks & The Internet

Internet Governance

  • No single entity runs the Internet
  • Governed by shared protocols, procedures, technologies (standardisation)
  • Supervised by ICANN (Internet Corporation for Assigned Names and Numbers)

Internet Infrastructure: Overview

  • Structure: Tier 1 networks form the Internet backbone
  • Maintained by ISPs (Internet Service Providers), data exchanged at IXPs (Internet exchange point)

Hardware for Computer Networks: Routers

  • A router helps us forward packets to the clients and servers. Routers also help us handle the allocation and deallocation of Private IP addresses.

Application and Services

Part 3/4

Servers and Backend

  • Recall: Requests go to a server, which returns a response
  • Focus: How do servers figure out what information to return?
    • Google
    • Facebook

Client-Server Model from a Software Side

  • Server:
    • Your server is a piece of software that runs on a computer to cater to requests from other software applications.
    • Whenever you open a web page, you go through the networking infrastructure and reach a device that has software for the server. You can configure your server software using programming languages such as Python, Java, and JavaScript.
  • Client:
    • Like a Server, the client is also a piece of software capable of communicating over the network. We do not have to look at the networking hardware-specific details in client software. These clients often directly interact with the application layer of the TCP/IP model.
Type of Server Description
Web Servers Networked computing devices that serve web pages
EMail Servers Computing devices that can facilitate email exchanges
Game Servers A multiplayer online game requires a centralized coordination point; it is usually a networked computer designed to handle the in-game interaction among many players, e.g., CS Go, Minecraft servers.
Real-Time Communication Servers Instant messaging applications require specialized computing devices that can facilitate real-time communication.
Application Server Specialized application-specific servers that serve a specific purpose for a client application. These servers often implement a programmable interface for client applications known as API.

Information Storage: Databases

  • Understanding Databases
    • Strength: Ability to store and process information
    • Structure: Like a giant Excel sheet with many rows
    • View: Choose certain columns or filter rows with specific features
    • Example Query: Finding users in Maastricht with specific login and friend request criteria
    • Basic Idea: Store vast information, search based on requests

Power of Data

  • Discussion
  • Question: What sorts of data do you think your favourite websites store?

Power of Data

  • Discussion
  • Question: What sorts of data do you think your favourite websites store?
  • Rule of Thumb: Every click, view, and mouse hover is recorded
  • Usage: Understanding user behaviour, popular content, and user preferences

Google: Getting Information

  • Indexing the Internet
  • Process: "Spiders" or "Googlebots" crawl and index the internet
  • Method: Start on a page, index that page, follow all outbound links
  • Storage: All information is stored in a database, including words on pages

Google: Evaluating Relevance

  • How Google Ranks Pages
    • Request: Includes search terms
    • Analysis: Derive meaning using Natural Language Processing
    • Search: Look for terms, synonyms, and title relevance
    • PageRank: Measure of website importance, similar to academic citations

Facebook: Storing Friends

  • Social Network Structure
  • Graph: Represents friendships
    • Nodes = People
    • Edges = Friendships
  • Other Graph Uses: Internet, road networks, disease outbreaks, company hierarchies

Storing Other Information

  • Facebook's Data Storage
    • Content: Likes, comments, posts, live videos, messages, etc.
    • IDs: Assign to users and interactions
    • Tables: Database tables linked by IDs
    • News Feed Algorithm: Rank content by relevance, popularity, and recentness

Internet Advertisements

  • Targeting and Bidding
  • Targeting Methods:
    • Individuals (Facebook)
    • Search terms (Google)
    • Search history (third-party cookies)
  • Campaigns: Have a budget and bid per view or click
  • Ad Placement: Based on bids

Another Note About Ads

Developing for the Web

Part 4/4

Distributed Systems: Theory

  • Problem and Solution
    • Problem: Expensive memory and CPU
    • Idea: Link cheap computers into a "giant" computer
    • Method: Each computer solves/stores part of the problem
  • Challenges:
    • Computer failures
    • Storing information across multiple computers
    • Waiting for all computers to finish calculations

MapReduce

  • Parallel Processing
    • Idea: Faster CPU executing many instructions simultaneously
    • Method: Each computer solves part of the problem
    • Famous Example: WordCount

Distributed System: Databases

  • Structure and Relationships
    • Storage: Across many computers (distributed system)
    • Benefit: Spatially disperse knowledge
    • Structure: Like a giant Excel sheet with numerous rows
    • Components: Tables representing objects, relationships between tables

AWS (Amazon Web Services)

  • Amazon's Revenue Source
    • Revenue: $80 billion in 2012
    • Services:
    • Manages servers (cheaper, scalable)
      • Amazon S3 (storage, e.g., Piazza)
      • Easy website hosting

Programming the communication with a Server

  • Application Programming Interface acts as an intermediary between two applications (usually client and server).
  • APIs define what operations can be performed on the server and how those operations can be executed, and the data format used for communication.

APIs (Application Programming Interfaces)

  • Abstraction and Access
    • Concept: Abstraction - use without knowing how it works
    • Definition: Set of commands for data access
    • Availability: Many companies offer APIs (e.g., Twitter, NASA )

Serilizing and Deserializing Data

An iOS application is usually written in Swift; however, most of the server-side applications are usually programmed in Python, Java, JavaScript, or PHP.

Formatting Data

  • Structuring Data for APIs
    • Organization: Data must be well-organized
    • Format: Commonly use JSON ; alternative is XML
    • Example: Structured class information
"class": {
	"name": "BCS1110",
	"students": ["Ashish", "Tony"],
	"location": {"building": "PHS", "number": "20", "capacity": 100}
}

Code in the Real-World

  • Challenges and Solutions
  • Discussion: Challenges in large companies like Facebook

Code in the Real-World

  • Challenges and Solutions
  • Discussion: Challenges in large companies like Facebook
  • Testing:
    • Unit tests
    • Integration tests
    • Development servers
  • Version Control: Handling multiple people editing code (e.g., GitHub)

Human-Computer Interaction

Part 5/4

Human-Computer Interaction (HCI)

  • Idea: how can we make computers accessible for everyone?
  • Design for a target audience
  • Make computers usable and intuitive (work in progress)
    • Related question: how can we make technology accessible for everyone
  • Build upon abstractions
  • UI (user interface) and UX (user experience)

Importance of HCI

  • Remote Control Buttons (usable in the dark?)
  • Norman Doors
  • Three Mile Island Nuclear Disaster "Valve is Open" warning light

Steps for Good Design

  • Simplicity
  • Clarity
  • User-Testing and Feedback
  • Design for an Audience

Dark Patterns

  • Good UI should make it easy to do what the company wants you to do
  • Dark Pattern: a UI trick that makes users act in a certain way
    • LinkedIn Contacts
    • Delete your Amazon account by having to contact a human
    • Automatically opted into emails
    • Forced Continuity: free trials end by automatically charging your credit card
    • Hard to unsubscribe from email lists
    • Confusing language, strategic button highlighting

Darkside of Technology

  • People spend a lot of time on electronic devices (Source: Hackernoon)
    • Over 4 hours a day on mobile devices (phones and tablets)
      • Millenials check their phones 150+ times per day on average
      • Social media apps are designed to "suck you in"
        • Likes, etc., fulfill need for validation (sort of like a slot machine)
          • Message alerts pressure you to respond right away (and response-in-progress keeps you in the app)
          • “Rewards" for being on apps more frequently (Snapchat)
          • Notifications
          • Endless scrolling (versus discrete pages)
          • Problem: companies make money from ad views; more time on app => more ad views

See you in the lab! 👋🏼