[[CS260F25]] Midterm Review Class
## Entry Ticket
1. Store state inside the req & resp, carry all the state with oyu but you tke that cost seach trip. YOu can alos use cookies to store state, but they can be tmapered with easy
2. [[REST|Restful]] Limitations:
1. Server responses can only happen after client requests, so the server can't initiate
2. Can't typically keep up with Real-Time updates
## Review
The [[CS260F25]] midterm will be in [[Plato]].
Slides cover the major subject areas so far, this is not comprehensive tho.
Test question come from:
- notes
- The book, entry readings
- The entry tickets & contents
- Lecture slides
During the test you may use:
- Your study guide
- Your book
- Your notes
- Print outs
The telegraph, having a layer of signals and such,
- *Western Union Telegram* -> Datagrams, self contained & carries arbitrary data, independent of other telegrams, and is ignorant of the medium.
Telegraph Networks:
- succesfull telegraph operator means you must understand $\pm$ one layer of abstraction
[[OSI Stack]]:
- Designed by comittee
- Protocol for each layer
- All layers make promises and impose requirements on their neighbors.
[[TCP-IP Model]]:
- More useful version of the [[OSI Stack]]
Arpanet History:
[[Arpanet]] started out to share scarce resources, experimented in packet switching, worked out the basics of what would become [[TCP-IP Model]] ,
Worked with Interface Message Processors
Store and forward, simiple but robust routing, but the adress size was only $5$ bits long.
[[IPv4 Address|IPv4]] :
- 32 bit wide
- Was not partinioned optimally so we ran out
- Combined with a [[Subnet Mask]], bit anding them together will tell you the adress, AND adress and inverse of the mask will be the host. The lowest values are reserved for the network-id
Given a subnet mask,
- Identiify the network and host
- what is the network ID
`192.168.0.56` / 24
`/24` -> `255.255.255.0`
Consider `192.168.68`
- Is this adress IN that network or oUT?
Some ip ranges are reserved for private use, [[Network Address Translation]],
- routers can rewrite packets as well as inspect them.
- technically cheating the OSI model
[[Simple Traversal of UDP through NAT]]
- Known 3rd party proxy
- Players connect to proxy
- Proxy tells players about each other
- Players communicate through this proxy
NAT Types:
- Strict/[[Symmetric Matrix|Symmetric]]
- Most restrictive
- breaks [[Simple Traversal of UDP through NAT]] but has the best security
- Open / Full [[Cartesion Plane]]
- Least restrictive, easiest for game devs
- Hole through firewall
- Moderate / Port Restricted
[[IPv6]]:
- 128 bit address space
- Very slow adoption
- More complex than ipv4
- Not backwards compatable
- Requires gateways to go from ipv4-ipv6
- Will exist side-by-side for some time.
TCP Solves the hard problem of packet switched networks:
- Reliability: packets are lost or damaged
- Order: Packets are delivered in whatever order they arrive, not same order as sent (normally)
- Abstraction: underlying technology affects packets but we can just interact with 'streams'
- Packets are discrete but conversation is continuous
TCP Solutions:
- Reliable
- Automatic Splitting
- Streams
- Throttling
- If overloading, send fewer packet at a time
- Throughput available ([[Little's Law]])
Sequence of calls to make a TCP connecion
Compares to UDP:
- TCP came first
- One size fits all
- UDP is easier to work with & we can build things on top of that, tCP can be heavy wait
- Low overhead
- Stateless, no connections to main intrinsically
Sequence of alls to make a UDP connection
Protocols:
- UDP - [[User Datagram Protocol]]
- TCP - Transmission Control Protocol
- IP - Internet Protocl
- ICMP - Internet Control Message Protocol
- ARP - Adress Resolution Protocol
- [[Hypertext Transfer Protocol|HTTP]] - [[Hypertext Transfer Protocol]]
- [[Domain Name Server|DNS]] - [[Domain Name Server]]
![[Little's Law]]
Through is messages over time
We can because we can alter occupancy to try getting better throughput, one way measurement.
Bandwith is the maximum data transfer rate of a network (theoretically possible)
- Round Trip Time - ms
- Jitter - Change in ltency
TCP Solution: Flow Control & Send Queues
- Balances length of send queu vs other factors
DNS:
- Cache results agressively (values have a 'lifetime')
- Recursive structure
Before DNS:
- HOST file, distributed by hand
- Outgrew this early
- Local HOSTS file is still useful for development and testing
TCP & UDP sockt API differences
- Closing UDPtocket vs closing a TCP socket
- Non blocking techniques (what does that mean?)
- Error handling
[[Hypertext Transfer Protocol|HTTP]] :
- Originally documents contain links to other documents
- Universal Resource Locators, Content Types, not just text
- Instead of docs we can now serve applications
HTTP Verbs:
- GET, POST, PUT, DELETE (HEAD, TRACE, OPTIONS, PATCH <- less interested in these)
[[REST]]:
- Representational State Transfer
- Because HTTP is stateless, but state is useful
HTTP Response Codes:
- 100 - Informational
- 200 - Sucess
- 300 - Redirection
- 400 - Bad request
- 500 - Server fault
## Sample Questions
1. Whn tearing down tcp connections, the passive closer finishes sending and then sends a FIN packet. The passive close is now waiting in the state called (useful diagram for notes in review slides):
1. a. LAST_ACK
2. How does the DNS system handle domain names that contain unicone
1. it does not intrisically, but there is PUNICODE which translates it to a subset of ascii
3. Which of these statements summarizes little laws?
1. We desire increased throughput, so we measure latency and adjust occupancy
4. Given this network: Ip adress 162.17.191.218, Netmask: 255.255.255.192 /26
1. Network ID - 192 , 162.17.191.192
2. Broadccast Address? 162.17.191.255
3. Range?