Computer Networks Midterm

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

DNS: caching, updating records

caches the IP of the hostname and of the TLD DNS server for the host cached entries may be out of date, but they remain until they expire

Key parts and uses of UDP

"best effort" --> might loss segments or segments may arrive out of order connectionless --> no handshaking so no connected sockets, all conenctions for the same port go tot he same socket Uses of UDP: -loss tolerate, rate senstive applications (ex// Skype) -when overhead of handshake is too large (ex// DNS) -when don't want congestion control mechaism from TCP (ex// Google Chrome)

TCP Socket Programming

-3-way handshake --> create TCP socket by specifying IP address and port # for the socket -after connection is made to server, server makes a connected socket to use to talk to the user so the listening socket is open to listen for other connections --> connection oriented server: socket(), bind(), listen(), accept(), recv(), send(), recv(), close() client: socket(), connect(), send(), recv(), close() server:: serverSocket = socket(AF_INET, SOCK_STREAM) serverSocket.listen(1) # 1 = how many clients waiting in the queue while True: ....accept() # make new connected socket .... ....close() # close the new connected socket and then go back to listening socket to wait to call accept again

DSL access network

-DSL = digital subscriber line -uses existing telephone line from phone company connected to DSLAM (DSL access multplexier) -every home has their own dedicated line that connects directly to the DSLAM -line is split between internet and data

DNS (domain name service)

-application layer protocol -provides mapping btw IP address and hostname --> uses distributed database implemented in a hierarcy of named serverd (b/c centralized database would give a single point of failture) -host aliasing --> alias name vs real name -mail server aliasing

non-persistant HTTP

-at most one object send over TCP connection before it is closed (need to open a new connection for every request) -good for doing requests in parrell -lots of overhead from doing handsake for each newly opened conenction 1) HTTP client init TCP conenction on part 80 2) server accepts connection 3) client sends HTTP request 4) server sends HTTP response 5) server closes the connection repeat for every object (MUST get the base HTML file first so know what other objects to request)

Multiplexing at sender

-breaks message into segments -adds headers (used for demultiplexing) to every segment -handles data from multiple sockets

TCP closing a connection

-client, server close their sides by sending TCP segment with FINbit = 1 -when receiver gets FINbit = 1, sends response with ACK with FINbit=1 -both can send FINbit=1 at the same time -->clientSocket.close() --> you can no longer send but you can receive data --> sender and client wait a little bit before closing the connection to ensure that all bits in the pipe arrive

rdt 3.0 (alternating-bit protocol)

-handles packet loss using a timer --> retransmit the packet if sender doesn't receive an ACK in a reasonable amount of time - receiver must again send seq # with ACK - timer based on expected RTT -duplicat ACKs --> 2 of the same seq #s together preformace: D_transmisision = L/R sender utilization --> not good b/c has a stop and wait protocol

UDP segment header

-has source and dest port # -has checksum to detect errors -has length of segment including the headers -32-bits wide -relatively short headers compared to TCP

TCP segment structure

-has source and dest port #s -has seq # -has ACK # (can send ACK with data, called piggybacking, not mandatory) -has rwnd filed set by the receiver to say how much free space it has in its buffer, flags for urgent data, ACK validity, other flags -checksum -options -data 32-bits wide

persistant HTTP

-multiple objects can be sent over a single TCP connection btw server and client -server leaves the connection open for sometime until period of inactivity -less overhead b/c don't have to do a ton of handshakes

Causes/costs of congestion with finite buffers (situation 2)

-one router, 2 senders, 2 receivers, finite buffers -retransmission of timed-out packets (lost packets) -->in' = in + retranmissions 1)idealization: only send packet when you know you have buffer space -->linear up to R/2 and then stops b/c will never send more than buffer can handle 2) only retransmit when packets known to be lost (can drop packets now) -->linear close to R/2 and then log like until constant 3) duplicate packets (realistic) -->linear less close to R/2 and then log like but NEVER gets to y = R/2 like the rest of the graphs

Key parts and uses of TCP

-point-to-point protocol (one sender, one receiver) -reliable, in-order BYTE stream (not packets, need special chars such as \r\n to mark end of messages) -pipelined --> has TCP congestion and flow control -full duplex data with MSS = max segment size to send one way -connection oriented (requires handshake) -uses cumlative ACKs, restarts time if still unACK'd packets after getting an ACK - timer for oldest, unACK'd packet only and retransmits only the oldest unACK'd packet on timeout -fast retransmit --> if get 3 duplicate ACKs, resend unACK'd segument with smalled seq # only (like a timeout)

packet-switching

-shared bandwidth -hosts breaks application-layer messages into packets -takes L/R seconds (transmission delay) to transmits L-bits over a link with capacity R -uses store-and-forward (all bits in packet must arrive at the router before packet can begin to be transmitted on next link) propogration delay = time it takes the bits to move through the router total transmission delay is sum of transmission delay over each link

Go-back-N

-sliding window protocol -cumlative ACKs (ACK(n) ACKs all packetups up to and including seq # N) -timer for oldest unACK'd packet only (timeout(n) --> retransmit packet #n and all packets with seq #s greater than n that are in flight) -retransmit all in-flight unACK'd packet when timeout -discards out of order packets + reACKs last successfully received packet when receives a packet out of order (can result in duplicate ACKs outisde of the sender's current window) -window just on sender -doesn't respond to duplicate ACKs (only timeout)

Selective Repeat

-sliding window protocol -must be careful about window size (seq#Size >= 2* windowSize) to sensure that old, retramitted packets aren't accepted as if they are new packets b/c of ACKs being dropped -individual ACKs (one per packet) -timer for each packet --> only retransmit that packet when there is a timeout -window on sender and receiver (might have different views) --> ex// receiver's ACKs so it can move its window forward, but then ACK is dropped so sender can't move its forward until it resends the packet and gets another ACK (NO cumulative ACKs) -buffers out of order packets and sender buffers out of order ACKs

UDP Socket Programming

-unrealiabe datagram, no handshake -sender explicatly attaches dest IP and port number to each packet sender: socket(), bind(), recv(), send(), close() client: socket(), send(), recv(), close() serverSock = socket(AF_INET, SOCK_DGRAM)

Demultiplexing at receiver

-use header info to deliver received seguments to correct socket works b/c host uses IP address and port number to direct the packet to the correct location (transport layer segement has source port and dest port, network layer datagram has source IP and dest IP) (remember, every TCP connection has its own connected socket, but UDP share one socket)

HTTP (for email)

-used to pull mail for mail server to user agent -still need to use SMTP to send mail from one mail server to another or from one user agent to mail server

Cable Network (access network)

-uses line for cable TV -cable is shared among many houses (every house gets every packet set) -downstream transmission rate is faster than upstream transmission rate -cable head is the only thing that sends data downstream (so no packet collisions going downstream)

Cookies: keeping "states"

1) 1st connection to a host --> get set-cookie: 1678 from the web server for the host, browser stores cookie (hostname, 1678) 2) go to the site again --> browser looks up cookie in cookie-file browser puts cookie number in request to site browser/server can keep track of what you did last time (ex// your cart, recommendataions) security risk: websites are tracking you and can sell that info to other companies

Internet Protocol Stack

1) application layer (HTTP, FTP, SMTP, software) 2) transport layer (TCP, UDS, process data) 3) network (routing packets, IP) 4) link (data transforer between neighboring network elements, ex// wifi or ethernet) 5) physical (actual wire) every layer adds a header and the packet goes down and removes the header as the packet goes up router -> just had network, link, physcial layers switch --> just has link and physical layers

Walk through of accessing a video from a CDN

1) click on a URL 2) DNS query goes to local DNS server 3) webservers authoriative DNS servers says where the video is stored 4) the local DNS server sends query to King's CDN authoriative DNS 5) IP send back to host 6) host requests video from IP address 7) you get the video

Inserting Records into DNS

1) need to register name at DNS register --> provide name and IP of authoritive name server --> insert 2 records (one mapping name to authoritive server and one mapping authoritive name server to IP) ex// lookup www.network.com --> browser queries local DNS for cache, doesn't get cache hit so goes to 13 root servers, goes to .come TLD server, sees the 2 records, reads both at once, gets the webserver IP by query DNS server from records, makes TCP connections use the IP it got, HTTP to get all the objects

How do hosts send packets of data?

1) take messages from app layer 2) breaks messages into packets of length L bits 3) transmits packets into access network at transmission rate R packet transmission delay = L/R = time need to transmit one L-bit packet over a link with capacity R

TCP: detecting, reacting to loss

1) timeout --> cwnd gets set to 1 MSS, do slows tart until reach threshold (half of cwnd value when timeout occured) and then do congestion adversion 2) loss indicated by 3 duplicate ACKs TCP Reno: cwnd is cut in half and then congestion adversion is used TCP Tahoe: cwnd is set to 1 (always set to 1 when loss event suspected for TCP Tahoe)

Attaching DNS

1)DDoS attack (distributed DoS) bombard root servers with traffice (not successful yet b/c local DNS does lots of caching so most traffic doesn't get to root DNS servers) 2) redirect attack --> man-in-middle, IP addresses for fake websites

Mail Access Protocols

can't use SMTP to get receiver's mail to its user agent b/c the user agent isn't always on and SMTP is push-based options: POP (download), IMAP, or HTTP

Causes/costs of congestion with infiniate buffer (situation 1)

2 senders, 2 receivers one router, infinite buffer output link has capacity R no retransmissions -->max throughput is linear until R/2 when it becomes constant

Cookies

4 components: 1) cookie header line of HTTP response message 2) cookie header line in next HTTP request message 3) cookie file kept on user's host, managed by user's browser 4) backend database at webserver

!!!!!!!!!!!!TCP congestion control (AIMD)

AIMD = additive increase, multiplicative decrease; increase cwnd (sender window size) by 1 MSS every RTT until loss detected then cut cwnd in half after loss and start again -->cwnd changes dynamically based on perceived network congestion -->cwnd can't be bigger than rwnd (receiver window), LastByteSent-LastByteAcked <= cwnd TCP sending rate approx = cwnd/RTT bytes/second (wait about one RTT for all ACKs from cwnd bytes send, doesn't include transmission delay), so this is how it increases by 1 MSS every RTT --> have slow start, congestion avoidance and fast recovery to consider

What is an application?

Applications run on end system (not Network core devices) ex// email, web, text, P2P file sharing, skype, streaming video etc

Causes/costs of congestion with multi-hop (situation 3)

As red in' increases, all arriving blue packets at upper queue are dropped so the blue throughput goes to zero b/c red is closer to the router than blue so it hogs it -->when a packet is dropped, any upstream transmission for that packet is wasted linear not close to R/2 and then parbolocially decreases

Streaming Multimedia DASH

DASH = dynamic adaptive streaming over HTTP server has manifest file with diff chunks of the video (video encoded at diff rates) and URLs to them client periodically measures server-to-client bandwidth, consults manifest file based on avaliable bandwidth and requests one chunk at a time

Conditional GET

GET /index.html HTTP/1.0\r\n Host: www.example.com\r\n If-Modified-Since: Wed, 21 Oct 2015 07:28:00 GMT\r\n \r\n server response with either 304 Not Modified or normal response code (200 OK, 301 Moved Permanently etc)

HTTP request message format

GET \index.html HTTP/1.0\r\n Host: www.google.com\r\n ......................(more optional headers)....\r\n \r\n body -need blank line (\r\n) to mark the end of the headers -Connection: keep-alive --> persistant connection -tells you your format, language, encoding of character it accepts -written in human-readable form GET --> ask for an object and server sends it back POST --> form input, can also include form input after URL in GET method (ex// www.hi.com/search?cats&dogs) HEAD --> ask server for object but tell server to not actually send the object to you

What is HTTP?

HTTP = hpyertext transfer protocol uses port 80 client aka browser --> requests, receives, and displays web objects server --> sends objects in response to requests HTTP is stateless (b/c server doesn't want to have to deal with inconsistances if client or server fails so server doesn't remember what client asked for last)

SMTP vs HTTP

HTTP = pull based (ask server for stuff), each object encapsulated in its own response message SMTP = push based (give stuff to server), all objects encapsulated in one message

What network protocol does HTTP use?

HTTP uses TCP 1) client initiates TCP connection (handshake) to server using port 80 2) server accepts TCP connection from client 3) HTTP message exchanged btw server and client 4) TCP connection closed

HTTP Response Message Format

HTTP/1.1 200 OK\r\n Date:...\r\n Server:...\r\n Last-Modified:....\r\n \r\n data body (ex// requested HTML or image file) Need blank line to mark end of headers Last-modified can be used to see if cached objects have been changed recently first line = status line (200 OK, 301 Moved Permanently, 304 Not Modified, 401 Not Found)

Mail Message Format

Has header with To: From: Subject: that are diff from the STMP commands used for handshake b/c these are shown to the user body has the message in it

Packet Switching - when will packet loss occur?

If arrival rate to link exceeds transmission rater of link, queuing delay will occur If buffer is full or if no buffer, packets will be dropped (buffer in router b/c packets queued at the router)

IMAP

Internet Message Access Protocol -used to pull mail from mail server to user agent -keeps all message in one place (at the server) -allows user to organize messages in folders -keeps user state across sessions

Network structure

network edge = hosts (clients and servers), servers in data centers network core = interconnected routers, network of networks

How do you get objects of a web page?

Must FIRST load base-HTML file that has references to other objects (ex// HTML files, JPEG images etc) each object is addressable by a URL

Netflix vs YouTube

Netflix -- DASH, push-based cache, doesn't have own data center (uses Amazon cloud) YouTube -- HTTP, pull-based cahce, has own data center (Google)

Distributed Hash Table

P2P applicatiion assign an n-bit identifier to each peer (2^n peers) with keys [0, 2^(n-1)] hash function(k) = k mod 2^k

How BitTorrent works

P2P file distribution every file is divided into chunks peers in torrent send and receive chunks tracker --> distributed hashtable that tracks what peers are participating in a torrent torrent --> group of peers exchanging chunks of a file churn --> peers may come and go requesting chunks --> get a list of who has what and ask for rarest chunks first sending chunks --> send to top 4 ppl. sending you chunks at the highest rate (everyone else is said to be "choked"), optimisitically unchoke one random person every 30 seconds to see if you can get in their top 4 and to help newcomers get chunks

Client-Server vs P2P

P2P is self-scaling while Client-server increase linearly

Four sources of packet delay

Propgraion delay - amount of time it takes for the actual bits to go over the link (physical length of link/propgration speed) processing delay - looking up where to forward the packet to and checking for bit errors queuing delay - arrivial rate to link exceeds output link capacity so a queue forms (becomes infinitate as (aL)/R approaches 1) transmission delay - L bits in packet/R for link capacity, time it takes L bits to go over a link of capacity R d_nodal = processing delay + queuing delay + transmission delay + propogation delay (caravan analogy)

What is the internet?

network of networks hosts = end systems (phone, computer, server) billions of connected devices

DNS Protocol Messages

Query and reply messages both have the same format denotes whether it is a recursive or an interative query

More on queuing delay

R = link bandwidth aka link capacity (bps) L = packet length (bits) a = average packet arrival rate traffic intensity = (La)/R as traffic intensity increases to 1 (more work arriving at router than can be processed), the average queuing delay becomes infinite

non-persistent HTTP response time

RTT = round trip time = time for small packet to travel to the server and back 1) 1 RTT for handshake (client->server->client) 2) 1 RTT for request and response (client --> server-->client) 3) file transmission time (from server to client) total response time is 2RTT + file transmission time good for getting objects in parallel (MUST get base HTML file first so know what other objects to request in parrallel)

Adding security to TCP

SS2 --> application layer library that talks to TCP and adds encrystion, data integraity, and end-point authenticiation

client-server architecture

Server: always on-host with perment IP address, larger scale = data center Client: commicate with server, intermentially connected, dynamic IP (could have static), DON'T commicate directly with each other (commicate through the server)

Wireless access networks

Shared wireless access network connects end system to router through access points wireless LAN = local area network, feet radius (have a your home) wide-area wireless access = cellular network, miles radius

SMTP

Simple Mail Transfer Protocol push protocol (push emails to servers) uses persistent TCP with port 25 (handshake, transfer messages, close connection) message must be in 7-bit ASCII (encoding and decoding of message must be done) uses . to denote end of message

Connection-oriented Demux (TCP)

TCP: socket ID'd by source and dest IP AND source and dest port (4-tuple) all connections with unique 4-tuple are demux'd to diff sockets ex// non-persistent HTTP --> new TCP connection for each object, need seperate socket for each object

Electronic Mail

TODO

Internet Hierarchy

Tier 1 ISPs (ex// AT&T, Sprint) and Content Providers (ex// Google) IXP = internet exchange points regional ISPs access ISPs (most local level)

Fairness and UDP

UDP isn't fair b/c doesn't have congestion control mechanisim b/c wants to be faster than TCP --> hurts (slows down) TCP traffice

Throughput

bits/sec depends on the hardware being used rate (bits/sec) at which bits are transfered btw sender/receiver NOT the same as transmission delay (sec), which is the time it takes the bits send by the router to travel on the link to the desitination

What are the benifits of pipelined protocols?

allow senders to send packets back-to-back to improve preformace --> need to increase # of seq #s --> need buffering at sender and receiver (for out of order packets and ACKs) link capacity C gives RTT * C max unACK'd packets in the pipeline at once

Fairness, parallel TCP connections

applications can open mulitple parallel connections btw hosts and then get more bandwidth for their applciation compared to other applications with less bandwidth

How to assign keys in a distbuted hash table?

assign key to the peer that has the closest ID to the key where closest = immediate successor of the key ex// peers: 1,3,4,5,8,10,12,14 key = 13 gets assigned to peer 14 key = 15 gets assigned to peer 1 (wrap around with mod)

TCP Sequence Numbers

assigns seq #s to bytes, not packets ex// packet of 5 bytes with seq # 1 --> next seq # expected is 6 ACK --> seq # of next byte expected by the other side (nextSeq# = currSeq# + length(data)) --> uses cumaltive ack, if ACK(y) and y >sendBase --> shift window (this makes it somewhat okay to loss ACKs) --> undefined how to deal with out of order packets (options to either discard like Go-back-N or buffer like selective repeat), retransmissts one packet after timeout

rdt 1.0

assumes underlying channel is a reliable channel (no bit errors, no packet loss)

TCP throughput

avg TCP throughput = (3/4)(W/RTT) * MSS to get bytes/sec (w/o MSS, you have packets/sec) = (1.22 * MSS/ (RTT * sqrt(L))) where L is the loss probablity ex// 1500 byte segments, 100ms RTT, want 10 GBps throughput 10 GBps = (3/4)*(W/100ms) --> W = 83,333 in flight segments

Checksum Timer Sequence number ACK NAK Window (pipeling)

checksum --> detect bit errors in a transmitted packet timer --> deals with lost packets, can result in duplicate ACKs sequence numbers --> deals with duplicate packets and out of order packets (helps detect packet loss early by sending duplicate ACKs) ACK --> tell sender that a packet has been received corrently (for TCP, has next expected seq number that the side sending the ACK expects) NAK --> segument not received correctly, same as duplicate ACKs in some protocols (TCP, fast retransmitted after 3 duplicate ACKs) window --> senidng packets with seq number in a given range so can send multiple packets at once (better preformace than stop-and-wait)

Connectionless Demultiplexing (UDP)

clientSock = socket(AF_INET, SOCK_DGRAM) clientSock.bind(('',12345)) # bind client socket to a specific port number of the server side --> usually DON'T do this explicatly, instead the OS picks a port number for you host: directs packets based on their destination port number same dest port number with diff source IP and/or source port numbers go to the same socket in UDP

Principles of Congestion Control (TCP)

congestion --> too many sources sending too much info too quickly leads to buffer overflow, packet loss at rotuerts, long queuing delay at routers cost of congestion: -->retransmit packets that weren't corrupted b/c lost -->link can carry multiple copies of the same packet, slows down the whole system

What transport services does an application need?

data integrety timing throughput security time sensitive (ex// audio) or not (ex// file transfer)?

Circut Switching

dedicated link - end-end reourses allocated btw source and destination (no sharing even if the link isn't being used by that user) historically used phone networks You don't get resources if circut is already allocated to capacity FDM - divide frequency btw users TDM - divide time btw users

What are network protocols?

defined format and order of messages sent and received and actions taken on message transmission and receipt

Circuluar distributed hashtable

each peer has IP addresses only of immeidate successor and predessor O(N) messages on average to resolve a query with N peers --> send query (key) from node to node until gets to the closest successor of the key

Circuluar Distributed hashtable with shortcuts

each peer keeps track of IP address of predessor, sucessor, and shortcuts shortcuts are designed so each peer has O(log n) peers so it takes O(log n) messages per query

What protocol is email? What protocl is web? What protocol is streaming video?

email --> SMTP --> TCP web --> HTTP --> TCP streaming video --> HTTP or RTP --> TCP or UDP

Sender Utilization calculation

fraction of time the sender is busy sending U = (L/R)/(RTT + L/R) (not good if stop-and-wait protocol)

Telnet

gives you a non-encrypted TCP connection (HTTP NOT HTTPs) $ telnet ee.columbia.edu 80 GET /index.html HTTP/1.0 Host: www.ee.columbia.edu (press enter twice)

TCP fairness

goal: average rate per user is (bandwidth R of bottleneck link)/(number of users) ex// 2 connections give R/2 avg. throughput each max mean fairness --> give as much to poor users as can to help balnce with rich uers Why is TCP fair?: with two competing sessions, additive increase gives slope of 1 as throughput increases while multiplicative decreases decreases the throughput proportionally -->loss: decrease window by factor of 2 (divide vector (congestion rate 1, congestion rate 2) by 2) congestion avoidance: increase window linear (additive increase)

UDP checksum calculations

goal: detect flipped bits segement = seq. of 16-bit integers sender: add up all the 16-bit integers in the segment (with wrap around) and then flip all the bits (1s complement) to get the checksum. Send the checksum to the client in the UDP segment header receiver: add all the bits in the packet including the header and you won't get all ones if there are errors (2-bit errors can go undetected but 1-bit errors can't)

TCP connection management

handshake to agree on starting seq #s for both sides (connect() and accept() in python) need to have a 3-way handshake (client asks for connection, server ACKs request, client ACKs ACK) issues with 2-way handshake: -DOS attack with lots of half open connections that just take up ports on the server -inconsistent seq#s due to slow response by the server so client sends two requests with two diff starting seq numbers and then first one is approved but client thinks second one was approved SYNbit = 1 for client asking for connection and server responding and then SYNbit = 0 for last ACK

TCP flow control

idea: receiver controlls sender so sender doesn't cause overflow at receiver --> receiver adversises free buffer space by including the "rwnd" value in the TCP header -->sender limits the number of unACK'd packets to be less than or equal to "rwnd" to prevent buffer overflow at the receiver

persistant HTTP response time

if using pipelining, 1 RTT for handshake, 1 RTT for base HTML file, 1 RTT for all objects in base HTTML file = 3 RTT if not using pipelining, 1 RTT for handshake, 1 RTT for base HTML file, 1 RTT per object ref. in base HTML file

bottleneck link

link on end-end path that constrains end-end throughput ex// have 10 users sharing one link with rate R + have own upload links --> bottleneck is min of the client link, server link, or shared link (R/10)

DNS name resolution: iterated query

local DNS server contacts other DNS servers (starting with root DNS) and they all reply back to local DNS and tell it who to contact next

binomical distribution

n choose k = N!/(x!(N-x)!), N is the number of trails, x is the # of successful trials out of N trials, p is the probability of the event occuring

Addressing (Identifying) Professes

need unique ID for each process can't just use IP address b/c muliple processes on same host (each host has one IP) --> need to use IP address and port number as process's ID ex// HTTP uses port 80 ex// mail services use port 25

Explicit Congestion Notification

network-assistedn congestion contorl meachinism instead of TCP's end-to-end method receiver sets ECE bit on ACK segemtn to notify sender of congestion, sender decreases the amount it is sending accoringly until it receivers a packet with CWR (congestion window reduced) bit set

P2P architecture

no always-on server arbitrary end systems commicate with each other (request and give resources) self-scaling --> new user brings new demand and new resources more complex b/c users come and go and affect the resources available to other users

How to stream lots of content to lots of users all at once?

option 1: single, large mega-server, bu then one point of failure and doesn't scale well option 2: store multiple codies of videos at multiple geographiclly distributed sites (CDN) -enter deep --> push CDN servers into many access networks to get as close to the client as possible -bring home --> smaller number of larger clusters at POPs near but not in access networks need to cope with congestion

Packet Switching vs. Circuit Switching

packet switching allows for more users to use the network 1 MB/s = 1000 Kb/s link users use 100Kb/s when "active" active 10% of the time circut switching: (x users) (100Kb/s per user) = 1000 kb/s x = 10 users packet switching: if have 35 users, what is the probability that 10 are active? binomial distribution: (N!/(x!(N-x)!))(p^x)(1-p)^(N-x) (35!/(10!(35-10!)) (.1)^(10)(1-.1)^(35-10) = .0004

Should I always use packet switching?

packet switching is good for bursty data (ex// load a web page and then look at it) circut switching is good for audio/video b/c want to miminze delay even if can't serve many users problems with packet switching that circiut switching doesn't have: 1) congestion 2) possible delays + packet loss due to congestion

POP3 Protocol

post office protocol downloads emails --> things are inconsistent if download email on phone and then try to look at it on the computer b/c won't be there if downloaded elsewhere (can't re-read email if client changes) POP3 has "download-and-keep" option so you can download it multiple times to multiple user agents

Types of Processes

process = program running within a host client process = process that iniitcates commication server process = process that waits to be contacted

Sockets

processes send/receive info to/from socket think: front door

Traceroute

provides delay (time) measurements from source to router along end-end Internet path towards some desitination sends 3 packets per router and gets back the RTT from the sender to the router and back traceroute sends N groups of 3 packets to N-1 routers (lists 16 rows --> 15 routers) * = packets dropped, probably due to network congestion

Web caches (proxy servers)

proxy server acts as a client to the web server and a server to the user client use caching to reduce response time and reduce traffic on access link If object in cache and not modified, send that object. Otherwise, ask web server for object, send it, and update cache

Push-based caching vs pull-based caching

push-based caching = auto pushes diff encoding of videos from Amazon cloud to diff servers (Netflix) pull-based caching = server pulls from data center when asked and file isn't in cache

DNS name resolution: recursive query

puts burden on root DNS, semi-circle query

TCP Service Model

reliable transport flow control so don't overwhelem router congestion control (don't overwhelem network) requires handshake DOESN'T provide: timing, minimum throughput guarentee, or security

DNS records

resourse records (RR) RR format: (name, value, type, ttp (expiration time)) type=A for hostname and IP mapping type=CNAME for alias and realname type=NS for domain (ex// example.com) and hostname of authoraitice server for domain type=MX for hostname and mail server name

DNS Distributed Hierarchical Database

root name servers --> 13 world wide (contacted by local name server when it can't resolve a name) TLD, authoritive servers (gives the actual IP address) com, org, net etc--> provides mapping for authoritative hostname to IP local DNS servers --> each residential/university ISP has one when host makes DNS query, query sent to local DNS server that has cache of most recent name=to=address transcation pairs --> acts as proxy

Two Key Network-Core Functions

routing = determines the source-destination router for the packets to take across the network (routing algorithm based on looking at the packet header), routing table forwarding = moves packets from router's input to correct output link (occurs inside the router), forwarding table

rdt 2.1

sender retransmits packet if ACK/NAK are corrupted --> uses sequence #s to detect duplicate packets, receiver discards duplicate packets -only need 2 sequeunce numbers b/c only sending one pakcet at a time -must send checksum with ACK or NAK to see if they are corrupted -receiver doesn't know if last ACK was received by the sender

!!!! Time to distribute a file using client-server arch.

server --> must sequentially upload N copies of a file (time to upload one = filesize/rate of transer) --> (#copies * file size)/rate of transfer client --> each client must download a copy of the file d_{min} = clinet min download rate client time: #bits/d_{min} time to distribte F bits to N clients >= max{(#copies * file size)/rate of transfer, #bits/d_{min}}

!!!! Time to distribute a file using P2P

server -> must upload at least one copy (#bits/server upload rate) client-> each need to download a copy (#bits/min download rate (slowest rate)) --> need to download FN bits in total max upload rate = serer upload rate + sum of clients' upload rates distribution time >= max{#bits/server upload rate, #bits/min download rate, #users * # bits/(server upload rate + sum of clients' upload rates)} each client downloads and uploads the file

rdt 2.0

stop-and-wait protocol (sender sends one packet and then waits for receiver to respond) get all packets but some bits may be corrupted --> use checksum to detect bit errors receiver sends ACK if all good and NAK if bits are corrupted, sender resends the packet if it gets a NAK 1) error detection: checksum 2) error feedback: ACKs, NAKs problem: what if ACK or NAK is corrupted?

When you do switchi from expontial increase to linear increase for congestion control with TCP?

switch from slow start to congestion adversion when cwnd gets to half of its pervious value when the timeout occured (ssthresh = slow start threshold) -->switch from linear to expontial to minmize fluxation

Peer Churn

to a handle peers leaving, need to keep track of two next successors (not just one) periodilly check if successors are still around --> if one leaves, ask other successor who their next neighbor is to make that your next successor

Physical Media

twisted pair cable coaxical cable fiber optic cable

Functions for reliable data transfer diagrams

under transport layer is an unreliable channel rdt_send(data) --> called from above, passes data to deliver to receiver upper level udt_send(packet) --> called by rdt to transfer data over the unreliable channel to the receiver deliver_data(data) --> deliver data to the upper level rdt_rcv() --> called to get packet that arrives on receiver side of the channel

UDP Service Model

unreliable data transfer btw sending and receiving processes DOESN'T provide: reliabilty, flow control, timing, min throughput, congestion control has NO handshake

What use UDP?

use UDP if want lower delay (lower overhead b/c no handshake) and can tollerate loss ex// video streaming, DNS

rdt 2.2

use duplicate ACK instead of NAK to resend receiver sends ASK for last packet and explicatlly includes the seq # of the packet being ACK'd in make_packet (send packet 0, wait for ACK 0)

Enterprise Access Networks (Ethernet)

used by companies and universities end systems connect to Ethernet switches

What is a user agent? What is a mail server?

user agent - composing , editing, reading mail ex// Outlook, phone mail app --> outgoing and incoming mail is stored on a mail server mail server - mailbox: incoming messages for users, message queue of outgoing message

Fast Recovery

value of cwnd is increased by 1 MSS for every duplicate ACK received for missing segment that caused TCP to enter fast recovery state (3 duplicate ACKs received) for TCP reno (like congestion avoidance) when ACK for missing segment arrives, decreases cwnd and does congestion avoidance for real

Types of encoding for video streaming and content distribution networks

video = sequence of images displayed at a constant rate digital image= array of pixels (high res image = more pixels, compression = fewer pixels) temparal coding = only encode diff btw frames to reduce the number of bits/sec you have to send spatal coding = encode pixel as diff from pixel next to it CBR = constant bit rate, encode video at a fixed rate VBR = variable bit rate, encode video at diff rates (for ppl. with diff bandwidth)

Network Security

virus (executing object, ex// email attachment) worm (hold in software that someone exploits) spyware (ex// keystroke loggers) botnet (use your computers to attack others) DOS (denial of service attack) --> send a lot of fake requests to overwhelem resources and make them unavaiable to legimate traffic packet sniffing --> network interface that reads all packets that come through (ex// wireshark) IP spoofing --> send packets with fake source addresses --> need encrytpion and authentication added to the network

When sending packets, why include source IP address?

want to include source IP address and port number so you can send info back if you want (such as sending ACKs back)

TCP slow start

when connection, increase sending rate exponentially by doubling cwnd every RTT until there is a loss event (increase cwnd by one for every ACK received)


Set pelajaran terkait

Human Biology Quiz 1 Study Guide (Skeletal System)

View Set

Question 4-Explain 5 events that occur when a sarcomere contracts

View Set

Psych PrepU application style questions 51Q no ans choice w/exp

View Set

Psychology Final Exam Study Guide

View Set