Courses/Computer Science/CPSC 441.W2014

From wiki.ucalgary.ca
Jump to: navigation, search

Navigation

Course Overview

Application Layer

Transport Layer

Network Layer

Datalink Layer

Advanced Topics

Extra

Networking Basics

Chapter 2

Chapter 3

Chapter 4

Chapter 5

Chapter 7

Tutorials

Chapter 1

HTTP Over TCP

Chapter 6

Links

Quiz Review

Textbook Notes

Links

Directory of Readings and Slides for Class
Time Period Extra Readings Textbook Readings Slides Tutorial Resources
Week 1
  • Chapter 1: Section 1.1
  • Chapter 1: Section 1.2
Week 2
  • Chapter 1: Section 1.3
  • Chapter 1: Section 1.4
  • Chapter 1: Section 1.5
  • Chapter 2: Section 2.1


  • Socket programming references in C


Week 3
  • Chapter 2: Section 2.2
  • Chapter 2: Section 2.3
  • Chapter 2: Section 2.4
Week 4
  • Chapter 2: Section 2.5
  • Chapter 2: Section 2.6.1
Week 5
  • Chapter 3: Section 3.1
  • Chapter 3: Section 3.2
  • Chapter 3: Section 3.3
Week 6
  • Not on website but Carey mentioned this in the lecture
  • Chapter 3: Section 3.4
  • Chapter 3: Section 3.5
Week 8
  • Chapter 3: Section 3.6
  • Chapter 3: Section 3.7
  • Chapter 4: Section 4.1
  • Chapter 4: Section 4.2

Back To Navigation

Textbook Notes

Directory of Textbook Notes
Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7

Section 1.1 Notes

Section 2.1 Notes

Section 3.1 Notes

Section 1.2 Notes

Section 2.2 Notes

Section 3.2 Notes

Section 1.3 Notes

Section 2.3 Notes

Section 3.3 Notes

Section 1.4 Notes

Section 2.4 Notes

Section 3.4 Notes

Section 1.5 Notes

Section 2.5 Notes

Section 2.6.1 Notes

Back To Navigation

Introduction

Hello, my name is Carrie Mah and I am currently in my 3rd year of Computer Science with a concentration in Human Computer Interaction. I am also an Executive Officer for the Computer Science Undergraduate Society. If you have any questions (whether it be CPSC-related, events around the city, or an eclectic of random things), please do not hesitate to contact me.

I hope you find my notes useful, and if there are any errors please correct me by clicking "Edit" on the top of the page and making the appropriate changes. You should also "Watch this page" for the CPSC 441 page to check when I upload notes. Just click "Edit" and scroll down to check mark "Watch this page."

You are welcome to use my notes, just credit me when possible. If you have any suggestions or major concerns, please contact me at cmah[at]ucalgary[dot]ca. Thanks in advance for reading!

Course Information

Disclaimer: This is a page created by a student. Everything created and written by me is not associated with the Department of Computer Science or the University of Calgary. I am not being paid to do this nor am getting credit. I was a class scribe for CPSC 457 and enjoyed it so much that I wanted to continue it with a course related to it. I find writing Wiki notes for courses I am not familiar with are helpful for me, so I hope you find these notes helpful. I encourage that you still write your own notes, as it helps you retain information, but my notes are public and free to use!

This course is for W2014, taught by Dr. Carey Williamson.

The course website is here: http://pages.cpsc.ucalgary.ca/~carey/CPSC441

Networking Basics

Definitions

  • Computer Network: A set of autonomous computers that are hooked together somehow so that they can communicate with each other
  • Informal definition: set of computers that are hooked together somehow so that they can communicate
  • Hooked together somehow (wireless network interface, ethernet network, satellite link, fiber optic link), in some form of channel over some medium in which devices can communicate that can send network packets or exchange data in ways more valuable than a single computer
  • Examples:
  • Home network: wireless, desktops, gaming devices (wi-fi), servers, etc.
  • Multiple devices hooked up somehow and they can communicate. Can do more with a network than an individual computer
  • UofC campus network
  • The Internet
  • Protocol: The rules used for communication between two parties
  • The rules for how two entities communicate
  • Specifies types of messages you can send, syntax/format of messages, the order in which the messages might get sent, the timing of messages (what to do when you can't do anything)
  • Computer communication protocols are used in this course
  • Example: humans
  • One protocol: walk towards them, look them in the eye, shake their hand, etc.
  • When you follow the rules, it works well, if you don't it gets wacky
  • Example: if we shake with a left hand, it's hard to establish the connection when you don't follow the rules
  • What messages are responsible, what you do, etc.
  • Finite-state machines, how two machines talk to each other
  • Protocols get organized into a modular, well-defined structure
  • Stack: A pile of things, usually with one thing on top of another
  • Layered way of organizing communication protocols
  • Pile of stuff, where each protocol has a well-defined functionality that builds a service/value that offers up to the stack
  • The Internet is built using a layered stack of communication protocols
  • It takes the 'rat nest' of different protocols, into a 5-layered protocol stack that gives structure some meaning to how devices communicate

Protocols and Applications

  • May recognize:
  • Youtube
  • Point-to-point protocol (ppp): above physical layer used from modem to computer (remember 'dial-up' modems?)
  • Use telephone (analog from humans) and digital input from computer, to analog, through modem
  • How phone talks to modem pool to Internet service provider (on low level)
  • Hypertext Transfer Protocol (Secure) HTTP(S): Getting hypertext from The Internet. It lets you look at web pages, and (secure) would be for encrypted data (like the bank)

Internet Protocol Stack

  • Application users: supports end-user services and network applications
  • HTTP, SMTP, DNS, FTP, NTP
  • Users live at the top of the layer, using things like Youtube, BitTorrent, e-mail
  • Makes use of files - simple application protocols that deal with web pages, messages, video frames, attachments, etc.
  • Transport: end to end data transfer
  • TCP, UDP
  • Network: routing of datagrams from source to destination
  • IPv4, IPv6, BGP, RIP
  • Addressing and routing - where a given web server is and how to get there, breaks data into packets to relevant data
  • Data link: channel access, framing, flow/error control, hop by hop basis
  • PPP, Ethernet, IEEE 802.11b
  • Wi-fi, etc. protocols how to communicate over a single link over the entire Inernet
  • Physical: transmission of bits
  • Digital sends over communication into bits

Example: HTTP and TCP

  • The web uses HTTP and TCP (Transmission Control Protocol)
  • Web client and web server communicate constantly, back and forth
  • SYN first from web client to web server, SYN/ACK back, ACK and GET URL to web server; data appears; then FIN from web server to web client, FIN/ACK back, then ACK to web client
  • When you download a web page, it uses the application layer protocol (HTTP)
  • Underneath, it uses the transport layer (TCP) and it knows how to send data reliably between two computers over The Internet
  • Basically a conversation of "Hello web server, are you there?" "Yes SYN, who wants to know?" "It's me of course?" "What would you like today?" "I would like to get a web page"
  • There's a handshake when you meet, then a goodbye; the middle contains data that does useful stuff
  • Talk to the server: data comes across the network in network packets

Network Packet Structure

  • DataLink Layer Header -> Network Layer Header -> Transport Layer Header -> Payload
  • Packets are sent (envelope, wrapper around payload [message])
  • Payload: user level data
  • Who sent this (IP of website), destination address (of computer)
  • Transport Layer Header: outer wrapper
  • Example: TCP
  • Packets come from a web server, goes to the client browser
  • Network Layer Header: wrapper outside of that
  • Example: IP
  • IP packet of which computer it's going to
  • DataLink Layer Header: outer-most wrapper
  • Example: Wi-Fi, Ethernet
  • Wireless Wi-Fi header that says that packet allows communication

Warriors of the Net

  • Video link
  • Dawn of the net
  • Clicking a link: flow of information, traveling to ‘mail room’ and packages it and sends it
  • Packets limited in size, mail room divides appropriate sizes
  • Label: sender, receiver’s address, type of packet it is
  • Packet to internet: proxy server
  • Packet launched to LAN, a network used to connect all computers for information exchange within walls of building
  • Packet goes to a different network, the router - a systematic organization of packets
  • As packets leave router, they head to corporate Internet (router switch)
  • More efficient than router, routes them to their way – pinball wizard, leading packets on their way
  • As packets arrive to destination, picked up by network interface ready to be sent to the next level (proxy)
  • Proxy used by companies as a middle man to lessen load of connection, and for security reasons
  • Packets are various sizes depending on their content
  • Proxy opens packet, looks for web address (url)
  • If acceptable, packet sent to The Internet
  • Some addresses that don’t make approval of proxy (management, corporate disapproval) are ‘destroyed’
  • Corporate firewall: 2 purposes
  • Prevent nasty thing from The Internet to Intranet, and from Intranet (sensitive info) to Internet
  • Router picks up packet to a row (bandwidth) not broad enough for the road
  • If IP doesn’t acknowledge packet in due time, sends a replacement packet
  • Now, world of The Internet: interconnected networks spanning the world
  • Routers and switches establishes links across network
  • Request ping: mess up unsuspecting homes
  • The World Wide Web/Wait: routes taken may not be fast but it will get there
  • End of destination: another firewall
  • As a data packet, could be bastion of security of dreaded adversary
  • Depends on your intentions
  • Lets in packets that meet its criteria
  • Port 25 used for mail packets, port 80 used for packets from Internet to web server
  • Inside firewall, packets screened more thoroughly
  • Ping of death discuses itself as a packet, but firewall can notice it
  • Journey almost over: to be taken to web server (run on main frame, web cam or computer)
  • One by one, packets are received, opened and unpacked
  • Information it contains (your request) is sent to web server application
  • Packet itself is recycled, ready to be used again and filled with your requested information
  • Addressed, sent out on its way back to you – back the firewall, raptors and onto The Internet
  • Back through corporate firewall, and onto your interface, ready to supply web browser with requested information

Networks Recap

  • Why networks?
(1) Information sharing
(2) Share resources
(3) Remote access
(4) Economy of scale
  • Scale up instead of deploying individual machines
(5) “Network effect”
  • The whole is greater than the sum of the parts
  • Ex. If you have 3 friends who knows other friends, etc. – big network, access to everyone’s knowledge
  • Drivers of why The Internet was created in the first place
  • Internet “Big Three” for the birth of the internet
(1) Remote login
  • Able to access computing resources to somewhere
  • Protocol called rlogin created (telnet, ssh, secure shell)
(2) File transfer
  • Take data sets and analyze them using high performance computers in another place – way to move data files back and forth
  • ftp
(3) Electronic mail
  • Spinoff of file transfer as e-mail is another file
  • Did not anticipate what e-mail would become – people started using it

Assignment 1: Details

  • Similar to Warriors of Net – looking into packets and have a protocol of which packets are allowed and which are not
  • Need to know:
  • Program in C (first tutorial)
  • Socket programming (second tutorial)
  • Write a server (third tutorial)
  • Know how HTTP works (fourth tutorial)

LANs and WANs

  • Networks come in many shapes and sizes
  • LAN: Local Area Network
  • Limited geographic coverage, 1km or less (e.g. lab, building)
  • Example: Home network, campus network, Ethernet LAN, Wi-Fi
  • MAN: Metropolitan Area Network
  • If City of Calgary had something for downtown – metropolitan area
  • WAN: Wide Area Network
  • Large geographic coverage, 100 km or more (e.g. country, planet)
  • Cross city/provincial/national boundaries and network with a lot of different places
  • Country, planet, variety of technologies (fiber optics, cable, satellite network, different physical layered technology)
  • Different capacities/bandwidth, go different distances (home network)
  • Example: Cybera, cellular networks, Internet
  • Technologies differ (capacity, distance, cost)

Diagram: Networks

wxtmdbA.png
Bigger image
  • Network between home and UofC
  • You move around on the roads (links) in cars (packets)
  • On a path, there are links
  • Routes and paths have different speed limits and congestion rate (packet loss/delay)
  • You access a link by an edge
  • Low speed, low volume, access links to network
  • CORE
  • Similar to roads with no traffic lights and 3 lanes


  • Many concepts in computer networks come from other areas
  • Telephone network, postal system similar to this
  • Telephone network:
  • Phones, calls, trunk lines, toll offices, switching
  • Postal system
  • Letters/parcels, addresses, mail carriers, post office
  • Drop in mail, sent somewhere, and postal delivery system drops it off
  • Highway network
  • Cars/buses, streets/highways, congestion, collisions
  • Broadcast TV
  • Channels, stations, TVs, streaming (live/stored)

Communications Networks

  • Phone network vs The Internet
  • Similar goals, different mechanisms
  • Historically different philosophies of how you build
  • Phone: voice and Internet: data
  • “Telco” view (i.e. telecommunications networks to support voice telephony and other types of services, such as fax, data, location, etc.)
  • Telecommunication providers want to support voice
  • Other things like fax machines, data sources, etc. came along
  • Data networking view (i.e. the Internet)
  • Gets files back and forth
  • How to get across geographic locations, diverse climate, etc.?
  • Two approaches share some similar goals and challenges (e.g. scale, geography, heterogeneity), they have quite different underlying assumptions

Telco Networks

  • Over 100 years old
  • Designed for transmission of human voice, and make it transmitted in the same way
  • Take 8-bit sample being transmitted
  • Twisted pair copper wire for residential access
  • “Cheap,” adequate bandwidth, easy to handle
  • Aggregation of multiple calls at toll office for multiplexing/demultiplexing using TDM
  • Low bandwidth required per call (e.g. 64 kbps)
  • Fixed bandwidth required per call
  • Phone network, device is a telephone (cheap) and what comes to your house is a twisted copper wire (cheap) and functionality is minimal (call or answer a call)
  • Inside the network – trunk lines, access lines, toll officers, interexchange points, traffic exchanges, etc.
  • Make edge devices simple, and make the core complicated
  • Design: circuit-switching, telco networks are circuit-switched networks


  • Call routing and circuit allocation decided once per call at time of call arrival
  • End-to-end path allocation, with dedicated circuit (reserved bandwidth) per active call
  • If home phone wanted to call UofC phone, you pick up your handset, enter numbers, asks toll office (links with many wires inside of them, one of which you own) if there’s a way to connect, and it finds a path that works to make the UofC phone ring
  • End to end dedicated connection, in which humans can talk and listen
  • Dedicated circuit/path/wire, that you own for the duration of the call
  • Pay for how many minutes you use that line for
  • When a call is placed: find routing path, establish state information in each of the switches, using a specific line, to know who is talking to who using a specific line
  • This is circuit switching
  • All bits travel same path; stay in same order
  • Call state information crucial in network switches
  • Busy signal if no path possible (blocking <= 2%)
  • Billing model based on time used (in minutes)
  • Single class of service; high reliability (99.99%)
  • Additional services: faxes, modems, mobility…

The Internet

  • About 40 years old
  • Designed for transmission of data
  • Wide range of access technologies, devices
  • Wide range of user and application behavior (unpredictable)
  • Variable-size packets permitted
  • Bursty, variable bandwidth required by apps
  • Aggregation of traffic at routers/switches
  • Transmission links shared on stat mux basis
  • In The Internet, if I am sending data packets from home to UofC:
  • Data packet has a piece of information in front of a header/address of where we’re sending it to, who’s receiving and how big it is
  • Packet transmits to a different router, and router keeps sending them on a path
  • If link crashes, the previous router chooses another
  • Packet at a time, one router at time
  • Connection less protocol
  • Core simple, edge complicated
  • Packet-switched network


  • Connection-less network layer protocol (IP)
  • “Best effort” datagram delivery model
  • Packet routing decided on a per-packet basis
  • No end-to-end path allocation; no reserved bandwidth per active call
  • Packets can travel any path; packets can be delayed, lost, duplicated, re-ordered
  • Minimal state information in network switches
  • Single class of service
  • Billing model? (hours? Packets? Bytes? Bandwidth?)


  • Generate data packets, drop in mailbox and try to get it to destination
  • Service model: best effort
  • The Internet tries its best to deliver packet, some of them will get there and some will not. No guarantee that packet will be sent
  • If route fails, the packet gets dropped and the next packet comes along, with updated routing information
  • When it sees a broken link it goes to a different path
  • Usually the “best effort” routing algorithm yields the shortest path. If packets get lost, update it to go a different way
  • ICMP sends back error messages

Multiplexing

  • Multiplexing: doing more than one thing at the same time
  • Example: Walking and chewing gum
Time Division Multiplexing (TDM) Frequency Division Multiplexing (FDM) Statistical Multiplexing (Stat Mux)
  • Static channel allocation mechanism
  • Divides a fixed resource among N concurrent users
  • Done in the time domain (i.e. turn-taking, time slots)
  • Give each user all of the channel part of the time
  • Very efficient if N is fixed and all N users are active
  • Very inefficient for bursty and unpredictable traffic
  • Taking turns and being nice to others
  • Take a shared resource and divide it in explicit time slots so people take turns using it – you get all of it but only part of it
  • Example: A classroom gets time slotted – we share the resource, and get all of it but for only a short amount of time
  • Example: Classroom scheduling, traffic lights, daily TV programs; T1 digital transmission standard (1.5 Mbps)
  • Static channel allocation mechanism
  • Divides a fixed resource among N concurrent users
  • Done in the frequency domain (i.e. Hertz [Hz])
  • Give each user part of the channel all of the time
  • Very efficient if N is fixed and all N users are active
  • Very inefficient for bursty and unpredictable traffic
  • Fixed resource, carve it into pieces, assign pieces to particular station and have exclusive use of the piece
  • How radio stations work, televisions, wireless devices, etc.
  • Example: TV has different channels that all come in at the same time, but as a human you can only choose one
  • Know how many stations there are in advance
  • Example: Radio stations, TV channels, Wi-Fi channels; CRTC regulation of wireless/cellular technologies
  • Flexible (dynamic) channel allocation mehanism
  • Shares a fixed resource among N concurrent users
  • Done dynamically on a packet-by-packet basis
  • Give each user the channel when they need it (hope they don’t need it all at same time)
  • Very efficient for bursty and unpredictable (elastic: shrink/stretch to fit what you have) traffic, even if N us unknown or highly dynamic
  • Economists call it ‘laissez-faire’ – keep hands off, it will play it itself
  • The Internet: sends stuff whenever they want, and what happens in the core happens – some packets get there, but occasionally some get lost (protocols used)
  • Unsure of how many users there are, and when they’re going to send it; but if a packet comes The Internet will try to forward it
  • Example: Cars on city streets, letters sent during the holidays; Internet packets on ISP link (hook up links, takes traffic into/out of house and m ultiplex with stuff)
  • Depending how busy The Internet is, your file can be downloaded quickly or slowly

FDM vs TDM Diagram

uIePmzW.png

Summary

  • Key concepts that underly many of the computer networks that we will talk about:
  • Network edge: end system devices, access links, LAN
  • Network core: aggregation, switching, multiplexing, WAN
  • An ‘internetwork’ is a ‘network of networks’
  • Example: hoe to ISP, connected to Telus
  • ‘The Internet’ is a massive global internetwork
  • Protocols are the glue for putting these together

Back to Navigation

February 7: Quiz Review

Definitions

  • Computer network: set of computers that are hooked together somehow so that they can communicate
  • Internet built using layered stack of communication protocols
  • Protocol: rules used for communication between two parties
  • PPP: modem to computer
  • HTTP: get hypertext from Internet
  • Download web page: HTTP
  • Then send data between two computers over the Internet: TCP

Network Packet Structure

  • Data link -> network -> transport -> payload
  • Packets sent (wrapper around payload)
  • TL: outer wrapper, packets come from web server to client
  • NL: IP packet of which computer it goes to
  • DL: Wi-fi header that says packet allows communication

Networking Basics

  • Why networks?
  • Information sharing
  • Share resources
  • Remote access
  • Economy of scale
  • Network effect (whole > sum of parts)
  • Internet 'Big Three'
  • Remote login
  • File transfer
  • Electronic mail
  • LAN: home network, campus network, Wi-Fi
  • MAN: area in city
  • WAN: country, planet (cybera, cellular networks, Internet)
  • Internetwork -> networks of networks
  • Internet is massive global internetwork


  • Move on links in packets
  • Paths have different speed limits and congestion rate
  • Access link by en edge
  • Low speed, low volume
  • End system devices, access links, LAN
  • Core
  • Many links to edges (like roads wit no traffic lights and 3 lanes)
  • Aggregation, switching, multiplexing, WAN


  • Telco networks
  • Phone network with twisted copper wire, minimal functionality
  • Edge devices simple, core complicated
  • Design: circuit-switching
  • Find routing path, establish state information in each of the switches using a specific line to know how is talking to who
  • End-to-end dedicated connection
  • Bits travel in same order on same path
  • The Internet
  • Transmission of data, variable bandwidth required by apps
  • Data packets have headers (information) that transmit to a different router that sends them on a path
  • Core simple, edge complicated
  • Design: packet-switching
  • NL protocol
  • Packets travel any path (can be delayed, lost, duplicated, re-ordered)
  • Service model: best effort
  • If packet fails, next packet goes on a different route (update information)
  • Usually yields shortest path

Multiplexing

  • Time Division Multiplexing
  • Static channel allocation
  • Divides fixed resource among N concurrent users
  • Done in time domain (turn-taking)
  • Give each user ALL the channel PART of the time
  • Efficient: N is fixed, N users are active
  • Inefficient: bursty, unpredictable traffic
  • Shared resource, divide into time slots (exclusively use during that time)
  • Ex. Classroom scheduling
  • Frequency Division Multiplexing
  • Static channel allocation
  • Divides fixed resource among N concurrent users
  • Done in frequency domain (Hertz)
  • Give each user PART of the channel ALL the time
  • Efficient: N is fixed, N users are active
  • Inefficient: bursty, unpredictable traffic
  • Fixed resource, divide to pieces (exclusively use it)
  • Ex. Radio/TV channels
  • Statistical Multiplexing
  • Flexible channel allocation
  • Share fixed resource among N concurrent users
  • Done dynamically on packet-by-packet basis
  • Give each user channel when they NEED it
  • Efficient: bursty, unpredictable traffic
  • Ex. Carsoncity streets, Internet (unsure of how many users there are, but it will try to forward packets)

Internet

  • Hosts = end systems
  • Live at edge
  • Communication links: get bits from one side to another
  • Packet switches: forwards packets
  • Routers and switches
  • Live at core
  • Internet
  • Network of networks
  • Internet standards
  • Request for Comments (RFC): public open-source document
  • IETF have meetings
  • Infrastructure that provides services to applications
  • Provides programming interface to apps
  • Infrastructure that allows you to build apps (connects to lower-layered protocol and you build it)

Network Edge

  • Hosts: clients and servers
  • Sends packets of data
  • Takes application messages, break into packets of length L bits, transmits to access network at transmission rate R
  • Access to network, physical media
  • Wired, wireless
  • Network core:
  • Interconnected routers
  • Networks of networks
  • Owned by big companies
  • Link types
  • Link layered protocol
  • Point to Point
  • Dedicated link between two nodes
  • No MAC protocol since no one else can use the link
  • Ex. Dial-up modem
  • Broadcast
  • Shared link between many nodes
  • Need MAC to regular access since you share with other people
  • Ex. Wi-Fi


  • DSL
  • Voice, data transmitted at different frequencies over dedicated line to central office
  • Data goes over DSL phone line -> Internet
  • Voice over DSL phone line -> telephone
  • Cable network
  • FDM: different channels transmit on different frequency bands
  • Ethernet
  • Computers and router -> ethernet switch; institutional mail, web servers -> ethernet switch, both -> institutional router
  • WAN
  • Shared wireless access network connects end system to router via base station aka 'access point'

Transmission Media

  • Guided
  • Physical
  • Solid media
  • Bit: between transmitter/receiver pairs
  • Physical link: what lies between transmitter and receiver
  • Examples
  • Twisted pair: signal in one end, out the other
  • Coaxial cable: bidirectional, higher rate, longer distance
  • Fiber optic cable: multiple GB over extremely long distance, point-to-point transmission
  • Unguided
  • Invisible, signals propagates freely
  • Transmit signals on physical layer, may propagate through air
  • Microwave, LAN, Wide-area, Satellite

Network Core

  • Mesh of interconnected routers
  • Network providers live
  • Router
  • Packet-switching:
  • Packets forwarded from one router to the next, across links on path
  • Store-and-forward packet-switching
  • L/R seconds to transmit (PUSH) L-bit packets into link R bps
  • Entire packet must arrive at router before it can be transmitted on next link
  • Wait for entire packet to arrive,store in device (buffer), when link on other side (Ethernet) is available, send packet in its entirety at the link rate
  • Needs outbound link to be free


  • Queuing delay, loss
  • If arrival rate exceeds transmission rate, packets will queue or dropped if buffer fills up
  • Drop tail - drop newly arrived packet
  • Nodal processing delay
  • Checks bit errors, determines output link
  • AL -> NL, processing time happens in host
  • Queuing delay
  • Time waiting at output link for transmission
  • Depends on congestion level of router, wait to go onto link
  • Large waiting line - FIFO queue
  • Transmission delay
  • How long it takes to push a packet out to the link
  • Propagation delay
  • Finite time of bit from sender to receiver
  • Throughput
  • Whichever is slowest/weakest link
  • Bottleneck link: link on end-end path that constrains end-end throughput
  • Cannot go faster than smallest pipe


  • Routers route and forwards
  • Routing: determines source to destination route taken by packets
  • Uses routing algorithms, done periodically
  • Looks up address in routing table (what header value goes to which output link)
  • Communicate with other routers, builds database, populates to routing table which may affect others
  • Forwarding: move packets from router's input to appropriate router output
  • Done for every packet, makes use of database
  • Packet switching vs circuit switching
  • Packet switching allows more users to use network

Internet Structure

  • Peering relationships between big network service providers
  • Peering links between different ISPs
  • Internet exchange points mandated by Government controlling packets
  • Point of Presence: router for moving traffic to other network providers as well as others to customers

Protocol Layers, Service Models

  • Layer structure allows identification, relationship of complex system's pieces
  • Modularization eases maintenance, updating of system

Internet Protocol Stack

  • Application
  • End-user services and network applications
  • HTTP, SMTP, DNS, FTP, NTP
  • Sends messages
  • Transport
  • End-to-end (process-process) data transfer
  • TCP, UDP
  • Sends segments, pieces of a file
  • Network: speaks language every computer understands
  • Routing of datagrams from source to destination
  • IPv4, IPv6,BGP, RIP, routing protocols
  • Addressing, routing
  • Sends packets
  • Data link: physical transmission
  • Channel access, framing, flow/error control, hop-by-hop basis
  • Data transfer between neighboring network elements
  • PPP, Ethernet, IEEE 802.11b
  • Wifi, etc. protocols how to communicate over a single link over the Internet
  • Sends frames
  • Physical
  • Transmission of bits
  • Digital sends over communication
  • Sends bits
  • Intermediate device in backbone: router
  • Partial stack: NL->DL->PL

International Standards Organization Reference Model

  • How to make different systems talk to each other
  • Presentation
  • Allows applications to interpret meaning of data
  • Encryption, compression, switching data formats from IBM to ASCII, machine-specific conventions
  • Internet doesn't care
  • Session
  • Synchronization, checkpointing, recovery of data exchange
  • Manages robustness and reliability of a conversation
  • AL -> presentation -> session -> TL -> NL -> DL -> PL


  • Encapsulation
  • Message -> TL (header added, control info, IP address) -> NL (MAC) -> PL
  • Go down: protocol stack encapsulates with headers; go up: validate content, strip headers
  • Talk horizontally: protocol, talk vertically: interface, API

Sockets

  • Interface between application and network
  • App creates socket, socket dictates style of communication, pass data to socket for network transmission, receive data
  • Sends/receives messages to/from socket
  • TCP
  • Reliable delivery, in-order, connection-oriented, directional, guarantee delivery
  • UDP
  • Unreliable delivery, no order, no connection (app indicates destination for packets), receive/send
  • Server
  • fd = socket(domain, type, protocol)
  • Choose port a socket connects to
  • status = bind(sockid, &addrport, size)
  • When connecting, OS assigns free port for outgoing connection and receiving end is informed of the port; server listens for incoming requests
  • listen(sock, queulen)
  • accept(sockid, &addrport, &addrlen) (establishes connection with TCP)
  • count = recv(sockid, &buf, len, flags) (data request from client)
  • count = send(sockid, &buf, len, flags) (data reply to client)
  • read()
  • close() (end of file notification)
  • Client
  • socket -> connect(sockid, &addrport, addrlen) -> write -> read -> close
  • Connect assigns random free port

Architectures

Client-Server

  • Server: special
  • Always-on host, permanent IP address
  • Data centers for scaling
  • Clients: come-and-go
  • Communicate with server, dynamic IP address
  • Intermittently connected

P2P

  • No always-on server
  • Arbitrary end systems directly communicate
  • Peers request and provide service to other peers
  • Self scalable: new peers bring new service capacity and demands
  • Peers intermittently connected, change IP
  • Negotiate sharing of content
  • Everyone is equal, play symmetrical role of provider and consumer


  • Process communicating
  • Process is program running within host
  • Client process: initiates communication
  • Server process: waits to be contacted
  • Built using socket API
  • App-layer Protocol
  • Types of messages exchanged back and forth
  • Message syntax: what fields in messages and how fields are delineated
  • Where URL goes, what commands go to
  • Message semantics: meaning of information in fields
  • GET
  • Rules for when/how processes send and respond to messages
  • Who talks first, what to do when message arrives, how to handle wacky behavior
  • Open protocols
  • Defined in RFCs, public protocol
  • Proprietary protocols
  • Don't want to tell anyone how it works, internal secret protocol used (Skype)

Transport Services for Apps

  • Data integrity
  • Reliable data transfer, like client wants exact copy of web page
  • Timing
  • Low delay can be effective (interactive games), fast responses may be needed
  • Elastic timing (file)
  • Throughput
  • How much data does app need to pump
  • Videos should sustain throughput, might see pauses or glitches
  • Security: on network, encrypted form so no one can steal it

Internet Transport Protocols

  • TCP
  • Gets all data there eventually (slow)
  • Reliable, flow control (sender won't overwhelm receiver), congestion control (throttle sender when network overloaded)
  • No timing, minimum throughput guarantee, security
  • Connection-oriented: setup required between client and server
  • Ex: E-mail remote terminal access, web, file transfer, streaming multimedia, internet telephony
  • UDP
  • Gets most data there quickly (fast)
  • Minimal mechanism, generates data
  • Unreliable
  • No reliability, flow control, congestion control, timing, throughput, guarantee, security, error-checking, connection setup
  • Ex: streaming multimedia, internet telephony


  • TCP and UDP: no encryption, cleartext passwords sent to socket
  • SSL: provides encrypted TCP connection, data integrity, end-point authentication
  • SSL is at app layer

HTTP

  • 1.0 (classic)
  • One HTTP request per TCP connection, serially
  • Vertical dimension - time
  • Round-trip interaction between client and server to retrieve object and close connection
  • Inefficient
  • Parallel
  • Concurrent TCP connection to make things faster
  • Spawn threads to get different elements
  • Each initiates TCP connection concurrently
  • Supported by most modern browsers
  • Works regardless of which server objects are hosted on
  • Persistent
  • Reuse same TCP connection for multiple HTTP transfers serially
  • Amortizes TCP overhead, maintains TCP state longer
  • Server keeps connection alive for short period of time in case there's more
  • When client stops asking (GET), server closes connection
  • Only works if objects on same server
  • HTTP/1.1 (pipelining)
  • Requests issued asynchronously on persistent connection
  • Requests are processes in proper order; clever packaging
  • Bundle HTTP requests; get base page, when parsing there are more elements
  • Issue GET for both elements back-to-back, perhaps in same TCP packet


  • Host stores object,pathname contains file
  • Hostname converted from name to 32-bit IP address (DNS lookup)
  • Client: browser that requests, receives (using HTTP protocol) and displays Web objects
  • Server: web server sends (using HTTP protocol) objects in response to requests
  • Use TCP
  • Client initiates to server, port 80
  • Server accepts TCP connection from client
  • HTTP messages exchanged between browser
  • HTTP 'stateless' - no information about past client requests
  • HTTP/1.0
  • Single request, single response, transaction-based interaction
  • Stateless, non-persistent (one object sent over TCPconnection)
  • Above TCP, verifies web page exists and connection state so reliable data transfer occurs
  • One RTT to initiate TCP connection; one for HTTP request; file transmission time (time from server to send file to client)
  • GET, POST, HEAD
  • HTTP/1.1
  • Request-response interaction
  • Persistent connection, avoids TCP connection negotiation and termination -multiple objects sent over single TCP connection
  • Pipelining
  • Passwords, caching, cookies
  • Faster, more efficient and complicated
  • Server leaves connection open, one RTT for all referenced objects
  • GET, POST, HEAD, PUT, DELETE
  • HOST header mandatory
  • Request types
  • GET: browser retrieves from server some file or resource
  • HEAD: get meta-data from server
  • POST: send data to server
  • Format: keyword, value
  • Finish with carriage return and line-feed
  • Status codes
  • 200 OK
  • 301 Moved Permanently
  • 400 Bad Request
  • 404 Not Found
  • 505 HTTP Version Not Supported


  • Cookies
  • Cookie header line of HTTP response message, in next HTTP request message; cookie file kept on user's host, managed by browser; back-end database at website
  • Header is set-cookie header
  • Used for - authorization, shopping carts, recommendations, user session state
  • Keep state with protocol endpoints, cookies
  • Web caches (proxy server)
  • Goal: satisfy client request without involving origin server
  • Web accesses via cache - important for efficiency
  • Browser caches images, installed by ISP
  • Proxy is both role of client and server
  • Reduces response time for client request, reduces traffic
  • GET: response from server contains no object if cached copy up-to-date
  • 304 Not Modified, 200 OK <date>


  • Server in nutshell:
  • initialize; set up listening socket;
  • do { get request; process; send request; log request (opt); }
  • initialize: socket, bind, listen, while { accept }
  • Processing request
  • getsockname, gethostbyname, gettimeofday, read, serverParse

FTP

  • Transfer files to/from remote host
  • Client/server: client initiates transfer, server remote host
  • Client browses remote directory, sends commands over control connection
  • When server receives file transfer command, opens 2nd TCP data connection for file to client
  • After transferring one file, server closes data connection
  • Maintains state: current directory, earlier authentication
  • Control part
  • Single persistent TCP connection
  • Initiated by client
  • Session state
  • Data part
  • 0 or more non-persistent TCP connections
  • Initiated by server
  • One connection per file transfer

Electronic Mail

  • Three major components
  • User agents
  • Mail reader: compose, edit, read mail messages
  • Mail servers
  • Mailbox contains incoming messages for user
  • Queue of outgoing mail messages
  • SMTP
  • Between mail servers to send e-mail messages (client sends, server receives)
  • Three phases: handshake, transfer messages, closure
  • Can send without using e-mail client/reader
  • Use persistent connections
  • PUSHES vs PULLS from HTTP
  • HTTP: encapsulates object in its own response message
  • SMTP: multiple objects sent in multi-part message
  • POP
  • Authorization, download
  • Mail arrives at SMTP server, messages stored on device and not at server
  • Can't re-read e-mails if client changes
  • POP3 'downloads and keeps' and is stateless
  • IMAP
  • More features including manipulation of stored messages on server
  • Remote manipulation of content, stays on server but remotely access and read from anywhere
  • Keeps message at server, allows users to organize messages in folders
  • Keeps state - name of folders and mappings between message IDs and folder name

DNS

  • Map from readable text name to actual IP address (for Internet hosts and routers)
  • Client -> DNS before setting up socket and GET
  • AL: hosts, name servers communicate to resolve names
  • Hostname->IP translation
  • Host aliasing: canonical, alias names
  • Mail server aliasing
  • Load distribution: many IP addresses correspond to one name
  • Cannot centralize DNS: issue of scale, single point of failure, traffic volume, distant centralized database, maintenance


  • Root name servers
  • Contacted by local name server that cannot resolve name
  • Contact authoritative name server if name mapping not known, gets mapping, returns mapping to local name server
  • Website from left is most specific to least specific; resolve starting from right side
  • Generic top-level domain servers
  • For businesses/advertising
  • com, org, etc.
  • Authoritative DNS servers
  • Provides hostname to IP mappings for organization's named hosts
  • Non-authoritative
  • Anything that comes out of a cache
  • Local DNS name server
  • Doesn't strictly belong to hierarchy
  • Each ISP has one
  • When host makes DNS query, send to local DNS server (has local cache)
  • Iterated query
  • Different servers consulted, originating DNS server does heavy lifting
  • Most commonly used, answer only at local DNS server
  • Recursive query
  • Name resolution burdens contacted name server
  • Originating computer asks local DNS server, finds it for you and passes down - makes each server do lots of work for you, answer generated at end
  • Lots of caching; ttl (timeouts) but will be remembered for some amount of time
  • TLD servers cached in local name servers, thus root name servers not often visited


  • DNS Records, RR format: (name, value, type, ttl)
  • type=A
  • Name (hostname), value (IP) - mapping of given hostname to IP
  • Authoritative and definitive
  • type=NS
  • Name (domain), value (hostname)
  • Domain managed by name server
  • Parse domain, consult someone - entry tells you who name server is for that domain
  • type=CNAME
  • Name (alias, www.ibm.com -> servereast.backup1.ibm.com), value (canonical name)
  • Alias magic changes internal name without changing external
  • cname keeps track of different names and correct addresses
  • type=MX
  • Value (name of mailserver)
  • DNS entry where mail server is - tells SMTP to contact to transfer in/out of domain


  • DNS protocol, messages
  • Identification, flags, number of questions, number of answer resource records, number of authority RRs, number of additional RRs, questions, answers, authority, additional info

Calculation

  • Network bandwidth: data rate
  • 1000 bits (8 bits in 1 byte)
  • 1 kbps = 10^3 bps
  • 1 mbps = 10^6 bps
  • 1 Gbps = 10^9 bps

Hosts

  • Packet transmission delay - L-bit packet into transmission rate R
  • L (bits) / R (bits/sec)

Store-and-forward

  • End-end delay = 2(L/R)

Delay Calculation

  • Transmission delay: L packet length (bits), R link bandwidth (bps)
  • L/R
  • Filesize/datarate
  • Propagation delay: d length of physical link, s propagation speed
  • d/s
  • distance/speed

Course Review

  • Definitions
  • Computer network, protocol, protocol stack
  • Internet Protocol Stack
  • 5-layers
  • Physical: bits
  • How they get transmitted across physical medium to the receiving side
  • Technologies: twisted pair, co-axial cable, etc.
  • How bits might get encoded (tutorial) - transmitting digital bits
  • NrZ, Manchestor (what Ethernet uses) encoding
  • Datalink: frames (aggregate unit of bits)
  • Technologies: Ethernet, Wi-fi
  • Checksums, addressing, medium access control
  • MAC, LLC; small sub-layers
  • Static (TDM, FDM), dynamic (ALOHA, etc.)
  • Network: datagrams (packets)
  • IP (IPv4), datagram vs circuit-oriented, best effort network
  • Routing algorithms, link state, distance vector states
  • BGP, RIP, OSPF
  • Transport: segments
  • TCP, UDP
  • Application: messages
  • User-view of how messages (e-mail, etc.) get exchanged
  • Peer-to-peer or other ways
  • Quiz: application
  • Midterm: application, transport
  • Final exam: primary emphasis is network, datalink, physical
  • Many on network layer (service models, routing) and datalink (channel access protocols, error-checking and reliability, addressing mechanisms)
  • A bit on physical layer (Choices, transmission properties, characteritcis, possibly encoding of bits)
  • Material in lectures, what's assigned in readings, done on assignments and covered in tutorials
  • Maybe sneak in useful links if was discussed for a while

Day in the Life of a WWW Request

  • Optional: section 5.7 -- link layer 5-90
  • When user opens browser and requests for Google page:
  • Connects to network and gets valid IP layer identit
  • Laptop connected, plugged in Ethernet port and connected to switch; needs to get an IP address to commmunicate in valid fashion
  • Uses DHCP (network layer) as a way of managing IP addresses dynamically
  • DHCP request set on UDP
  • Request/eleast DHCP server and switch learns, etc. (missed stuff)
  • DHCP client receives ACK reply
  • Learn where default gateway is
  • Once you have IP address of gateway, need to find out MAC address
  • Use ARP
  • ARP quer responds with 'I own that IP address'
  • Mapping of IP to MAC exists - can send an IP packet now
  • Want to query Google webpage, but unsure of webpage
  • Send DNS query, find out IP of Google
  • Goes through ISP, comcast looks up Google's address, find it in database and repsond
  • TCP SYN request to Google - are you willing ot set one up? They will say yes, and goes back to client
  • Client can generate HTTP request and send into TCP socket, goes to Internet to server and server gives back webpage you were looking for and now on screen of your laptop
  • 24 steps in section 5.7
  • Need:
  • Internet routing, DNS mapping, how to route, set up TCP connection, send HTTP request inside TCP connection, receive packet

Review Topics

MAC vs LLC

  • Logical Link Control
  • Dynamic techniques: ALOHA (pure, slide), CSMA (CD, CA)
  • Medium Access Control
  • Only needed when you have a shared broadcast-based shared transmission medium
  • Static techniques: TDM, FDM, CDMA
  • If you know how many stations you have
  • Functionality that are sub-layers at datalink layer

Final Exam Tips

  • Mix of blooms taxonomy layers
  • Quiz, midterm was foundational knowledge (definitions, fact-based)
  • Final - basic knowledge, but also learn and apply
  • Compare and contrast questions (e.g. distance vector vs link state to route)
  • Understand what they are, compare and identify strengths/weaknesses
  • Knowledge + comprehension + application/knowledge
  • Problem-solving question
  • How to design a network - physical hard drives, satellite link, etc. (application/analysis)
  • Understand choice of media, bit rates, error checking, apply to a particular problem
  • Open-ended question at the end
  • Allows you to think outside the box and beyond course
  • Buffer bloat for example (Useful links)
  • Similar structure
  • Objective MC (10) - fact-based knowledge
  • Protocol stack/layers/layer-violation issues - understanding/compare and contrast
  • Lots of compare/contrast
  • IP addressing/routing
  • Understand prefixes, routing tables, difference between intra-domain and inter-domain routing (autonomous system and how they exchange packets thrugh gateway routers)
  • Data link layer/LAN
  • Medium access control protocols and how we improved - conceptual knowledge

Back to Navigation