New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

Computer Networks

by: Ashleigh Dare

Computer Networks ECS 152B

Ashleigh Dare
GPA 3.75


Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Class Notes
25 ?




Popular in Course

Popular in Engineering Computer Science

This 128 page Class Notes was uploaded by Ashleigh Dare on Tuesday September 8, 2015. The Class Notes belongs to ECS 152B at University of California - Davis taught by Staff in Fall. Since its upload, it has received 49 views. For similar materials see /class/187799/ecs-152b-university-of-california-davis in Engineering Computer Science at University of California - Davis.

Similar to ECS 152B at UCD

Popular in Engineering Computer Science


Reviews for Computer Networks


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 09/08/15
Lecture 10 Transport Layer Pr39ev summary H U I TCP SendRecv Buffers q Seq Ack 39 pipelining Link Today39s lec l39ur39e TCP Ia rencies Connec r Close ECS 1525 Computer Networks Demet Aksoy Overview Congesuon wmdow 1n segments Nwhumlooo 01234567891011121314 Numb er of transmlssnons ECS 1525 Computer Networks Demet Aksoy 2 How does actual TCP latencies I like Assumptions Q latency um39il Assume fixed receipt of the congestion window W object throughput of R bps 5 M55 bits TCP connection 039 object size bits establishment no retransmissions no data transfer delay at I055 quot c r39rquot39P39ri quot1 the rate arranged by the window size ECS 1525 Computer Networks Demet Aksoy 3 Fixed Con CSTIOH Window E v TWO C dSCSl ACK 0 ives before window39s worth of dd 1 2 Wai r for ACK affer sending window39s worth of EXCEE N data self Inmate TE F 5 um 331 Case 1 Infancy ZRTT Case 2 latency 2RTT OR K15R RTT WSR laTency 2R TT 0R max0 K1R RTT WSRJ ECS 152B Computer Networks Demet Aksoy Dynamic CongesTion Window mmate TCF Eunnemmn tune a Saner K windows cover the object K p09 2051W K71 lafency 22 TT 0R max0 2 512 12 TT 2k3915R J kl ECS 152B Computer Networks Demet Aksoy Dynamic CongesTion Window Te hm 339 em a sarier Ou of infinif windows will stall Q fimes Q Llogz1RTTSRJ 1 Cu of K windows will sfall P Times P min Q Kl lafency 22 TT 0R PR TT5R 2 p152 ECS 152B Computer Networks Demet Aksoy Example Scenarios O 100 Kbytes a Large Object Slze s 536 bytes K 8 RTT100 ms in latency ZRT Ith slow T ECS 1525 Computer Networks Demet Aksoy Large Objecf 0 100 Kbytes a Large Object Slze s 536 bytes K 8 RTT100 ms latancy 1m Iansuission ram bps ECS 1525 Computer Networks Demet Aksoy Large vs Small Objecf O 100 Kbytes 0 5 Kbytes S536bytes K8 S536bytes K4 RTT100 ms RTT100 ms almcv sec ranmsun m hrs ranswsun rae bps ECS 1525 Computer Networks Demet Aksoy Example Scenarios O5Kbytes 0 Larger RTT s 536 bytes RTT1sec Latency Mm latency R OR P With slow OR 2RTT Start 28 Kbps 143 sec 3 34 sec 58 sec 100 Kbps 04 sec 3 24 sec 52 sec 1 Mbps 40 msec 3 20 sec 50 sec 10 Mbps 4mseo 3 20 sec 50 sec ECS 1525 Computer Networks Demet Aksoy Larger RTT O 5 Kbytes 0 5 Kbytes S536bytes K4 S536bytes K4 RTT100 ms RTT1 Sec almcy sen W nu ranmsunmmm alemv 51 answsun me bps ECS 1525 Computer Networks Demet Aksoy In Practice can be slower Slowstart algorithm Hos A Host B initialize Congwin 1 for each segment ACKed C win until loss event OR CongWin gt threshold 39 In practice slow start can result in a slower increase time than exponential ECS 1525 Computer Networks Demet Aksoy before exchanging data segmems Step 1 client end system initialize TCP variables sends TCP SYN contro seq s segment to server buffers flow control specifies initia seq info 69 RaviWindow client connection initiator Step 2 server end system Socket clientSocket new rsecelves syN39 replles W39fh Socketquothostnamequotquotport YNACK contro segment numberquot ACKs received SYN server contacted by client allocates buffers ocket connectionsocket welcomesacket accept 39 SP ac39f39es serverquot receiver initial seq ECS 1525 Computer Networks Demet Aksov 13 TCP Connection Management cont Closing a connection client closes socket clientSocketclose 0 cuequot close Step 1 client end system sends TCP FIN control segment to server close d wait Step 2 server receives FIN replies with ACK Closes connection sends FIN 2 o m N 9 tlmz ECS 1525 Computer Networks Demet Aksov 14 TCP Connection Management cont Step 3 client receives FIN replies with ACK Q client server Enters timed waitquot Cl 5iquot9 will respond with FIN ACK to received PINS he closing a Step 4 server receives ACK Connection closed ACK Note with small 3 closed modification can handly simultaneous FINs closed ECS 1525 Computer Networks Demet Aksov 15 TCP Connec rion Managemen r conT initiates aTCP connection WailJU SEEUHDS renews FiN receive SYN amp AI K send ACK geiiiwsi TCP server K client application lifeCYC ie receive ACL Inmates close connectlcn send nnmin sand FiN server application receive ACK creates a listen socket C i eni Serid Nothing I if ecyc Ie iiikt ii mi receive SYN Sei id SYN 2 ACK receive ACK serid riothirig receive FiN wm m Sei id ACK ECS 1523 Computer Networks Demet Aksoy 16 ECS 152B Computer Network Lecture 14 httpwwwcsucdaviseduaksoycourses05152bhtm1 Demet Aksoy Web and HTTP First some iargon Web page consists of objects Object can be HTML le JPEG image Java applet audio le Web page consists of base HTML le which includes several referenced objects Each object is addressable by a URL Example URL Uniform Resource Locator wwwsomeschooledusomeDeptpicgif hos r name PCquotrh name Browers Demet Aksoy HTTP overview HTTP hypertext transfer protocol Web s application layer protocol client server model client browser that requests recelves displays Web objects server Web server sends objects in response to requests 0 HTTP 10 RFC 1945 HTTP ll RFC 2068 PC running Hr Explorer running Apache Web Server Mac running Navigator Demet Aksoy HTTP overview continued Uses TCP client initiates TCP connection creates socket to server port 80 server accepts TCP connection from client HTTP messages applicationlayer protocol messages exchanged between browser HTTP client and Web server HTTP server TCP connection closed HTTP is stateless server maintains no information about past client requests aside Protocols that mamtam state are complex past history state must be maintained if serverclient crashes their views of state may be inconsistent must be reconciled Demet Aksoy HTTP connections Nonpersistent HTTP Persistent HTTP At most one object is Multiple objects can sent over a TCP be sent over single connection TCP connection HTTP10 uses between client and nonpersistent HTTP sewer HTTP 11 uses persistent connections in default mode Demet Aksoy HTTP Modeling Assume Web page consists of 1 base HTML page of size 0 bits M images each of size 0 bits Nonpersistent HTTP M1 TCP connections in series Response time 04 1OR 04 12RT T sum of idle times Persistent HTTP 2 RT T to request and receive base HTML le 1 RT T to request and receive M images Response time 04 1OR 3RT T sum of idle times Nonpersistent HTTP with X parallel connections Suppose MX integer 1 TCP connection for base le MX sets of parallel connections for images Response time 04 1OR 04X 12RT T sum of idle times Demet Aksoy HTTP response time Small RTT low bandwidth connection amp response time dominated by transmission time Persistent connections only give minor improvement over parallel connections Large RTT For larger RTT response time dominated by TCP establishment amp slow start delays Persistent connections now give important improvement particularly in high delayobandwidth networks Demet Aksoy Persistent HTTP Nonpersistent HTTP issues Persistent without pipelining requires 2 RTTs per object client issues new request OS must work and allocate only When pTGViOUS host resources for each 35139356 has been TCP connection reCfllV d but browsers often open one RTT fOT eaCh parallel TCP connections to referenced ObleCt fetch referenced objects Persistent with pipelining Persistent HTTP default in HTTP11 server leaves connection client sends requests as open after sending response soon as it encounters a subsequent HTTP referenced object messages between same as little as one RTT for all clientserver are sent over the referenced objects connection DemetAksoy HTTP example Suppose user enters URL wkwwcsucdavisedgmstructiondefaulthth V V host name path name 1a http client 1n1t1ates TCP connection to http server process at lb http server at host wwwcsucdavisedu Port 80 wwwcs ucdavisedu waiting is default for http server for TCP connection at port 80 accepts connection noti es 2 http client sends http request Client message containing URL into TCP connection socket http server receives request message forms response message containing requested tu me object instructiondefaulthtrnl 5 http client receives response sends message 111150 SOCket v message containing htrnl le 439 http sewer Closes TCP displays html connectlon Demet Aksoy HTTP request message two types of HTTP messages request response HTTP request message ASCII humanreadable format r39eques r line GET POSTGET somedirpagehtml HTTP11 HEAD commands Host www someschool edu User agent Mozilla4 0 heqdequot Connection close Imes Accept language fr C Nquot r39 r m a Ii39 gieduvextra carriage return line feed indicates end of message Demet Aksoy HTTP request message general format request line aywnin m swam Dem at Aksoy HTTP response message sTaTus Hne proTocol sTa I39us code HTTP1 1 200 OK sTaTusphrase Connection close Date Thu 06 Aug 1998 120015 GMT Server Apache130 Unix Last Modified Mon 22 Jun 1998 m Content Length 6821 Content Type texthtml header hnes dGTGegn 39 data data data data data requesTed F TAAL39fHe Demet Aksoy HTTP response message general format request IIne Status code examples 200 OK success 301 Moved Permanently 400 Bad Request 404 Not Found 505 HTTP Version Not Supported DemetAksoy try it out http client side 1 Telnet to UCD WWW server Open TCP connection To port 80 default http server port at wwwcsucdavis Anything Typed in sent To port 80 at wwwcsucdavis telnet wwwcsucdavisedu 8O 2 Type in 21 GET http request GET instructiondefault html HTTP1 0 Host wwwcs ucdav1s edu hi1 carriage return Twice 3 Look at response message sent by http server in response to your minimal but complete request Demet Aksoy Iiushannon telnet wwwucdavisedu 80 Trying 169237104199 Connected to www ucdavisedu 169237104199 Escape character is quot 39 GET indexhtm HTTP10 HTTP11 200 OK Date Wed 26 Nov 2003 202213 GMT Sener Apache1328 Unix LastModified Fri 14 Mar 2003 204919 GMT ETag quot723c24d42c23e72404iquot AcceptRanges bytes ContentLength 706 Connection close ContentType texthtml lthtmlgt ltheadgt ltmeta httpequivquotcontenttypequot contentquottexthtmcharsetiso 88591quotgt htmigt Connection closed by foreign host Demet Aksoy Uploading form input Post method Web page often URL method mcludes form mput Uses GET method Inpm is uploaded t0 Input is uploaded in URL server in entity body eld of request line httpwwwmwcomcgibindictionaryvatest Demet Aksoy Method types HTTP10 GET POST HEAD asks server to leave HTTP11 GET POST HEAD PUT requested object out of I39GSpOHSC uploads le in entity body to path speci ed in URL eld DELETE Demet Aksoy deletes le speci ed in the URL eld Userserver interaction authorization Author1zat1on control access Chem server to server content authorization credentials typically name password 401 authorlzatlon req 4quot WWW authenticate stateless cllent must present authorization in each request usual http request msg authorization header line Authorization abcd in each request A I h r USUCl P63 OHSC ms If no authorization header p p g SGI39VCI39 I39CfllSCS access sends usual http request msg WWW authenticate Authorlzatonz abcd 2 header line in response 4 l usual HP resp nse quot 59 l hing NI usual http request msg l Demet Aksoy Cookies keeping state Many major Web sites use cookies Four components 1 cookie header line in the HTTP response message 2 cookie header line in HTTP request message 3 cookie le kept on user s host and managed by user s browser 4 backend database at Web site Demet Aksoy Example Susan access Internet always from same PC She Visits a speci c e commerce site for rst time When initial HTTP requests arrives at site site creates a unique ID and creates an entry in backend database for ID 20 Cookies keeping state cont 1 2 Hi lllll clien r server 7 usual hTTp requesT msg server 012 4 usual hTTp response Set cookie 1678 7 crea res ID 6 0 66 1678 for user Y eoq usual hTTp requesT msg cookie 1678 J usual hTTp response msg l usual hTTp requesT msg cookie 1678 l usual hTTp response msg l cookie D e 4 specn lc 2 0 ac rion 0 O cookie spec rific ac rion Demet Aksoy 21 Cookies continued aside What cookies can bring COOkiGS and Dl iVaCVZ authorization cookies permit sites to Shopping carts learn a lot about you you may supply name and email to sites recommendations user session state h o o 0 Web emall searc engmes use red1rect10n amp cook1es to learn yet more advertising companies obtain info across sites Demet Aksoy Conditional GET clientside caching Goal don t send object if client has uptodate cached version client specify date of cached copy in HTTP request If modified since ltdategt server response contains no object if cached copy is up todate HTTP10 304 Not Mbdified client 22 server HTTP request msg If modified since ltdategt T object not HTTP response HTTP10 304 Not Modified 39 modified HTTP request msg If modified since ltdategt object HTTP response HTTP10 200 OK ltdatagt modified Ien1etksoy 23 Conditional Get ask to receive only if current obj eot stale GET instructiondefaulthtml HTTP11 HTTP11 200 OK Date Thu 6 April 2000 120015 GMT Server Apache130 Unix LastMbdified Sat 1 Apr 2000 062319 GMT Content Length 6821 Content Type texthtml data data data data data GET instructiondefaulthtml HTTP11 User agent Mozilla40 Accept texthtml imagegif If modifiedsince Sat 1 April 2000 062319 HTTP11 304 Not Modified Date Thu 8 Apr 2000 120015 GMT Server Apache130 Unix empty entity body Ien1etksoy Content distribution Web caching Content distribution networks CDNs Peertopeer le sharing Demet Aksoy 24 25 Web caches proxy server G031 satis client 1396 UCSt without involvin OI39l lfl g5 g g 39 grSCtS bI39OWSCI39C Cb accesses Via cache or39igin browser sends all HTTP Sevr requests to cache object in cache cache returns object else cache requests object om origin server then returns object to client client or39igin Ser39ver39 Demet Aksoy 26 More about Web caching Cache acts as both client Why Web caching and server Cache can do up todate check using I f Reduce response time for client request modified since Reduce traf c on an HTTP header institution s access link 1551163 Should caChe take Internet dense with caches r1sk and dellver cached b1 ca 99 t t object Without checking ena es poor Cor en Heuristics are used prov1ders to effectwely Typically cache is del1ver content installed by ISP university company residential ISP Demet Aksoy Assumptions average object size 100000 Consequences 27 Caching example 1 i i a Public Internet 15 Mbps access link or igin servers bits avg request rate from institution s browser to origin serves 15sec delay from institutional router to any origin server and back to router 2 sec institutional network utilization on LAN 15 utilization on access link 100 institutional total delay Internet delay CGChe access delay LAN delay 2 sec minutes milliseconds Demet Aksoy 28 Caching example 2 increase bandwidth of public access link to say 10 1mm 3 Mbps Conseguences utilization on LAN 15 utilization on access link institutional V 15 6W0 10 Mbps LAN Total delay Internet delay access delay LAN delay 2 sec msecs msecs institutional cache often a costly upgrade Possible solution g 6 gait3929 10 Mbps access link Demet Aksoy Install cache Consequence Caching example 3 suppose hit rate is 4 pubhc 40 requests Will be satis ed almost immediately 60 requests satis ed by origin server utilization of access link reduced to 60 resulting in negligible delays say 10 msec total delay Internet delay access delay LAN delay 62 sec 6Ol secs milliseconds lt 13 secs institutional network Demet Aksoy My Internet oru n servers 115AAbps access hnk institutional cache 29 30 Content distribution networks CDNs The content providers are or igin server the CDN customers in N0 America Content replication CDN company installs hundreds of CDN servers throughout Internet close to users CDN replicates its customers content in CDN i CDN distribution node servers When provider 9 updates content CDN CDN server u dates servers CDN Server p m S America CDN Server m ASIO in Europe Demet Aksoy CDN xample 31 Or igin Server gt a DNS query forwwwcdncom CDNS authoritative HTTP request for wwwfoocomsportssportshtm1 DNS Server HTTP request for ori S erV er wwwcdnc0mwww foocomsp0rts1uth gif Nearby WWWfO000m CDN Server com an distributes HTML cdncom Replaces distributes gif les httpwwwfoocomsportsruthgif 0 uses its authoritative With DNS server to route httpwwwcdncomwwwfoocomsportsruthgif Demet Aksoy redirect requests Lecture 2 Link Layer Pr39ev summary Ne rwor ks 739 A Pr o rocols Layers 39 4 layers of IP Link protocol stack Today39s lec l39ur39e Link Layer ECS 1525 Computer Networks Demet Aksoy IP Where do we sfcmd A network can be defined recursively as Two or more nodes Two or39 more connecfed by a link or networks connected by Two or mar nodes N M jD i ix ECS 1525 Computer Networks Demet Aksoy 2 Swi rched Ne rwor39ks telecommunication networks circuitswitched packetswitched FDM TDM networks datagram with VC s networks e g ATM X25 the Internet TC ECS 1525 Computer Networks Demet Aksoy 3 Swi rchi ng S rr39a regies Circui l Swi l ching carry bif sfreams reserve a pa rh bandwid rh buffers bw 2 hos rs e9 original Telephone ne rwor ks Packe I39 Swi l ching eg In l39er39ne r no pa rh is reserved no guaran rees bes r effor r uHosa ror e and r ECS 1525 Computer Networks Demet Aksoy Circui r Swi rching resources are reserved for The comple re sessIo limited resources buffers bandwidth need to suppott multiple simultaneous sessions host A I host B FDM Frequency Division Multiplexing Emil TDM Time Division Multiplexing frame ECS 1525 Computer Networks Demet Aksoy Pac ke r Switching resources are no139 reserved similar 1390 postal service s139oreandforward delays host A host B Em Statistical Multiplexing NOT like TDM ECS 1525 Computer Networks Demet Aksoy 5 PacketSwitching Delays I at eac nodal processing four sources of delay nodal processing delay l1 h p39 check bit errors determine output link IeLlIrIg queuing delay transmission time waiting at output link propagation for transmissio depends on congestion level of router transmis ion kpropagationa 4 nodal processing queuing ECS 1525 Computer Networks Demet Aksoy PacketSwitching Delays II Transmission delay Propagation delay Rlink bandwidth bps s propagation speed in Lpacket length bits medium 2X108 mSec time to send bits into I d lenglh f PhYSlcal link link LR propagation delay ds I No te s and R are very different quantities transmission propagation processing queueing ECS 1525 Computer Networks Demet Aksoy 8 S ror39e and Forward Delays Example hostA hostB I B bps I B bps I i F bits tutal data consider transmission delay only all other delays are negligible Fbxts mal data 2 packets each packet mm bus ECS 1525 Computer Networks Demet Aksov 9 S ror39e and Forward Delays Example hostA hostB I B bps I B bps I ttime 11 FZ B ECS 1525 Computer Networks Demet Aksoy 10 S ror39e and Forward Delays Example hostA hostB I B bps I B bps I ttime 2 11 FZ B ECS 1525 Computer Networks Demet Aksoy 11 S ror39e and Forward Delays Example hostA hostB I B bps I B bps I ttime 3 11 F2 B ECS 1525 Computer Networks Demet Aksoy 12 Swi rchi ng Summary circuit switching packet switching real Time services links underu rilized during silen r periods requires reserva rion complex s rar rup be r rer resource sharing more efficient ess cos rly To ini ria re ECS 1525 Computer Networks Demet Aksoy 13 Link Layer Transfer data ram from one no e To a jacenf node over a link Involves device driver in OS and nefwork inferface card I Physically connecting hosfs encoding raming error efecfioncorrecfion reliable delivery access control Example thernef Token rings efc ECS 1525 Computer Networks Demet Aksov 14 LI nk Layer SerVI ces Framing link access encapsulate datagram into frame adding header trailer implement channel access if shared medium physical addresses39 used in frame headers to identify source s different from IP address Flow Control pacing between sender and receivers Error Detection errors caused by signal attenuation noise receiver detects presence of er s39 r signals sender for retransmission or drops frame Error Correction receiver identifies and corrects bit errors without resorting to retransmission ECS 1525 Computer Networks Demet Aksov Link Layer Implemen ra rion implzmznfzd in adapfzr39 CMCIA cardE1 hzr nz card Typically includes RAM DSP chips hosf bus infer39facz and link infer39facz c data link frame ECS 1525 Computer Networks Multiple Access Links Three types of quotlinksquot point to point single wire eg PPP SLIP broadcast shared wire or medium eg Ethernet Wavelan etc Blah blah blah shared wire shared wireless satellite cocktail party eg Ethernet eg Wavelan switched eg switched Ethernet ATM etc ECS 1528 Computer Networks Demet Aksoy 17 Mul riple Access proTocols single shared communicafion channel I by nodes only one node can send successfully af a Time I mulfiple access profocol disfribufed al orifhm fhaf determines how sfafions share channel ie efermine when station can Trans 39 communicafion abouf channel sharing must use channel ifselfl what To look for in mulfiple access profocols synchronous or asynchronous informafion needed abouf ofher sfafions robusfness eg To channel errors performance ECS 1525 Computer Networks Demet Aksoy MAC ProTocols a Taxonomy Three broad classes Channel Parfifioning divide channel info smaller pieces Time slofs frequency allocafe piece To node for exclusive use Random Access allow collisions recover from collisions Taking Turnsquot Tightly coordinate shared access To avoid collisions Goal efficien r fair simple decen rralized ECS 1525 Computer Networks Demet Aksoy 19 E rher39ne r l dominanf LAN Technology cheap 5 for 100Mbs first widely used LAN Technology Simpler cheaper Than Token LANs and ATM Kepf up wifh speed race 101001000 Mbps 10basz T Twisted Pair loobase T Gigabif thzr nzf ECS 1525 Computer Networks Demet Aksoy 20 ETher39neT Fr39ame STr ucTur e Sending adap rer encapsula res IP da ragr am or ofher ne rwor k layer profocol packe r in ther ne r frame Preamble 7 byfes wifh pa 39er n 10101010 followed by one byfe wifh pa 39ern 10101011 used 1390 synchronize receiver sender clock rafes ECS 1528 Computer Networks Demet NEW 21 E rherne r Frame S rrucfure I Addresses 6 byfes frame is received by all adapfers on a LAN and dropped if address does not mafch I Type indicafes The higher layer protocol mosfly IP bu ofhers may be supported such as Novell IPX and AppleTalk I CRC checked at receiver if error is defecfed The frame is simply dropped ECS 1525 Computer Networks Demet Aksoy 22 IEEE 8023 Frame STr ucTur e Emil ECS 1525 Computer Networks Demet Aksoy IEEE 80211 Wireless LAN wireless LANs untethered often mobile networking IEEE 80211 standard MAC protocol unlicensed frequency spectrum 9OOMhz 24Ghz Basic Service Set 355 aka cellquot contains wireless hosts access point AP base station BSS39s combined to form distribution system D5 ECS 1523 Computer Networks Demet Aksoy 24 IEEE 80211 MAC Pro rocol CSMACA 8021165MA sender if sense channel idle for source destination others DISF sec DIFS Then Tronsmi r en rire frame no collision delec rion g if sense channel busy Then binary bockoff g 2 8021165MA receiver Z if received OK re rurn ACK of rer SIFS ECS 1528 Computer Networks Demet Aksoy 25 IEEE 80211 MAC Protocol 8021165MA Protocol oTherS source destination others Dig NAV Network Allocation Vector 80211 frame has transmission time field others hearing data defer access for NAV time units NAV defer access ECS 1528 Computer Networks Demet Aksoy 26 Hidden Terminal effecT I hidden Terminals A C cannoT hear each o rher39 obsTacles signal aTTenuaTion collisions aT B goal avoid collisions aT B CSMACA CSMA with Collision Avoidance b 27 ECS 1523 Computer Networks Demet Aksoy Collision Avoidance RTS CTS exchange CSMACA explicit channel some destination others DIFS reservation sender send short RTS request to send receiver reply with short CTS clear to send CTS reserves channel for sender notifying possibly hidden stations I avoid hidden station collisions NAV defer access ECS 1523 Computer Networks Demet Aksoy 28 Collision Avoidance RTS CTS exchange RTS and CTS snorli collisions less likely destination others of snorler durolion end resullsimilorlo collision deleclion IEEE 80211 olows I CSlllA reservolions polling from AP NAV defer access ECS 1523 Computer Networks Demet Aksoy 29 Encapsulation Frame 2 2 6 6 6 2 6 02312 2 Frame Duration Address Address Address Seq Address Payload CRC control 1 2 control 4 Frame control field expanded 2 2 4 1 1 1 1 1 Protocol 1 1 1 To From More version Type SUbtype Power More AP AP frag Rem mgt data WEP RSVd The 802 l lrome ECS 1528 Computer Networks Demet Aksoy Ad Hoc NeTworks Ad hoc neTwork IEEE 80211 sTaTions can dynamically form neTwork Wifhouf AP ApplicaTions lapTop meeTing in conference room car inTerconnecTion of personal devices baTTlefield IETF MANET Mobile Ad hoc NeTworks working group ECS 1523 Computer Networks Demet Aksoy 31 Point to Point Data Link Control as one sender one receiver one link easier than broadcast link no Media Access Control no need for explicit MAC addressing eg dialup link ISDN line popular pointtopoint DLC protocols PPP pointtopoint protocol HDLC39 High level data link control Data link used to be considered high layerquot in protocol stack ECS 1525 Computer Networks Demet Aksoy PPP RFC 1557 I packet framing encapsulation of networklayer datagram in data link frame I carry network layer data of any network layer protocol not just IP at same im l ability to demultiplex upwards I bit transparency must carry any bit pattern in the data field I error detection no correction I connection livenes detect signal link failure to network layer I network layer address negotiation endpoint can learnconfigure each other39s network address Error recovery flow control data reordering all relegated to higher layersll ECS 1525 Computer Networks Demet Aksoy 33 PPP DaTa Frame Flag delimi rer framing Address does no rhing only one op rion Con rrol does no rhing in The fu rure possible mul riple con rrol fields Pro rocol upper layer pro rocol To which frame delivered eg PPPLCP IP IPCP e rc info upper layer da ra being carried check cyclic redundancy check for error de rec rion variable length 1 1 1 10r2 20r4 1 011111101111111100000011 protocol info check 01111110 ag control ag address ECS 1528 Computer Networks Demet Aksoy 34 MTU Maximum Transmission uni139MTU is a chame l er is c of The link layer E rher ne r 1500 bytes FDDI 4352 by res Poin r ropoin r low delay 296 by res Pa I39h MTU Smalles r MTU in The pa rh between a source and a des rina rion ECS 1525 Computer Networks Demet Aksoy 3S De rer39mining MTU For39 Ethernet and IEEE 8023 There is a maximum limit on he size of frame Over 11455 bytes 32bi rs CRC is no r adequa re Cur r en r standard is 1492 bi rs For39 poinf I opoin r links Logical limi r To provide adequa re response Time for in rer39ac rive use ECS 1525 Computer Networks Demet Aksoy 36 Determining MTU Serial Line Consider a line speed of 96Kbps Asynchronous communication with 8 bit data and 1 start and 1 stop bit If we have a 1024 byte packet it will take 1066 ms to transmit A small telnet packet has to wait on the average 533 ms Reducing MTU to 256 bytes means that the maximum transmission time is 266ms and hence the average wait time is Having very small MTU results in high overhead ECS 1525 Computer Networks Demet Aksov 37 Lecture 11 Socke rs Pr39ev summary r Link 7 Ne rwor k Trampm Transpo r r Link Today39s lec l39ur39e Socke rs in between Applica rion and Transpor r ECS 1525 Computer Networks Demet Aksoy 1 WhaT is a SockeT Socke r door be rween applica rion layer d process amp Transpor r layer proTocol controlled by application PM developer quotmquot controlled by warm infer net ECS 1525 Computer Networks Demet Aksoy en en controlled by application veloper controlled by Applica rion Layer To Socke i 7 a Stack Pr o rocol W 39 PDU 3 frame SocketAPI converts generic application layer requests to speci c transport layer protocol operations ECS 152B Compu e w DemetAksoy 3 Application Layer CreatesUses Sockefs rwo pmcesus local or 39vAppl ica em scrim remo re communica re by 39 ocke ri sending da ra in ro socke r amp reading da ra our of socke r kemel space v process port number allows receiving host to determine to which local process the message should be delivered ECS 1525 Computer Networks Demet Aksoy SockeTpr ogr amming process H a fimsm mtions ltprotocol localiaddr local jar ltprotocol foreigniaddr foreign J3011gt CompBIB Socket Spccgflcarinn ltprotocol localiaddr local jO foreigniaddr foreign jOITgt lt 128563751490 128568673 230D ECS 1525 Computer Networks Demet Aksoy Transport Layer based Socke Socket API defines interface bw application and Transport serVIce TCP UDP TCP Transmission Con 139r0 Pro focal connectionoriented reliable allocafe resources buffers sfafe variables UDP User Dafagram Pro focal connectionless no reliable fasfer ECS 1525 Computer Networks Demet Aksoy 7 http TCP 80 e p TCP 2120 7 smtp TCP 25 r dns UDP 53 Socket programming with TCP application viewpoint TCP prowdes rehabc Irvorder er 0 bych between Chem and server Client specifies IP address port number of server process client initiates messaging ECS 1525 Computer Networks creates local TCP socket Server server must be up Si running server must have created the soc et that welcomes client39s contact When contacted by client server TCP creates new socket for server process to communicate with client accept allows server to talk with multiple clients Demet Aksov 7 Socket programming with TCP Example client reads line from standar 39 soc ket outTo Server stream server reads line from socket server sends back a welcome message to c ient client reads prints line from socket inFromServer stream ECS 1525 Computer Networks Input stream sequence of bytes into process Output stream sequence of bytes out of process outToServer inE romServer client socket Demet Aksoy 8 CIienTser ver39 socketL inferacfion TCP Client ereate seeketr eurmect tn hustid punx chantSucket sucketo cunnecmchentSuckeL TEL connchion szfup p serrq request usmg sucket sendhentucket b reaq repty trern sucket recv EMEHISDEKEL etese usehentucket ECS 1525 Computer Networks Demet Aksoy Server create SDEKEL pEIFFX fur mcummg request We rumeSucket sucketo bmdvve cumESuckEL hs tEanEhmmESDEKEL wattfur mcummg eurmeetmrr request EKEI ceptWEcumESuckeL reaq request trern ket revunnectmn5ucket WHIE repty tn sucket Endunnectmn5ucket etese dusecunnecuun5ucket Socket Fu ncTions communication endpoint endpoint SOCket SOCket client sewer The socke r in rer39face e39g39 sock provides generalized connec r func rions Tha r suppor r bind ne rwor k communica rion usin an ossible 9m yp accep r pr o rocols close Iis ren ECS 1525 Computer Networks Demet Aksoy Socket Fu ncTion socke ro Crea re a descrip ror in The socke r descrip ror Table for use in ne rwork communica rion returns an integer socket descriptor if error socket data structure socket descriptor table pointers to other socket structures socket close Demet Aksoy ECS 1525 Computer Networks Socket Fu ncTion Socket function specifies the type of communication protocol desired for network IO Sacrel runcnon include ltsystypeshgt include ltsyss ockethgt int socketintjumzly int 1179 int Fromm Retums nonnegative descriptor if OK1 if error E i D mputth m Demet Ksoy 1 Sockef FuncTion Parame rer39s int socketint amI int type int protocol description family description AFilN39ET IPv4 protocols AFilN39ET6 IPv6 protocols AFiLOCAL Unix domain protocols AFiROUTE Routing sockets AF iKEY Key socket 39pr SOCKisTREAM stream socket SOCKiDGRAM datagrarn socket SOCKiRAW raw socket AFilNET A177st AFiLOCAL AF7ROUTE Argosy llll milll sow llll mam vs Pam AF Address Family and PF Protocol Family Wlues ofaprotocol possible cmnhm tl to t mil are the same historic Demet Aksoy 13 intention ECS 1525 Computer Networks Bind Function Bind function is used to assign a local protocol address to a socket 0 uses a socket descriptor sockfd created by the socket function 0 uses protocolspecific address and its size myaddr addrlen include ltsyssockethgt int bind int wolfLl const struct sockaddr myuddr socklenit addJen Returns 0 if OK1 if error ECS 1525 Computer Networks Demet Aksoy 14 Bind Function 0 Servers bind their wellknown ports when they start Norma11y a TCP client does not bind a port number Vniy include ltsyssockethgt int bind int sokail const struct sockaddr m uddr socklenit uddr39hw Returns 0 if OK1 if error ECS 1525 Computer Networks Demet Aksoy 15 Bind Function 0 bindinglP address to a socket TCP server bind restricm the socket to receive connections destined only to thath address ie has multiple IP addresses TCP client assigns source IP address for sending datagrams Pmcerr speci er Rerult IP addrr Pan Wildcardquot 0 kemel chooses IP address and port Wildcardquot nonzero kemel chooses IP address process speci es port local IP addr 0 process speci es IP address kernel chooses port local IP addr nonzero process speci es IP address and port wildcard INADDRiAN Y IPv4 ECS 1525 Computer Networks Demet Aksoy Lisfen Function socket acin39c SOCWI pa star Vaccf default a socket used for a socket used to wait initiating a for an incoming connection connection I ism function 0 converts an unconnected socket into a passive socket indicating that the kernel should accept incoming connection requesm to this socket a created socket is assumed to be active ie a connect will follow 0 is called only by a TCP server Why ECS 1525 Computer Networks Demet Aksoy 17 T39 P tlmn39 1 139 mm 1 0 cullnetllun mam s 12 romplmrl unumnun HEM I 39ncomglete connec 39on queue inc1ude ltsyssockethgt int listen int wokEl int husk0g Retums 0 if OK1 if error the second argument buck1g specifies the maximum number of connections the kernel should queue for this socket ECS 1525 Computer Networks Demet Aksoy A ccepf Fu ncTIo n Accept function returns the next completed connection from the fr the completed connection queue 0 If the completed connection queue is empty process is put to sleep 0 if accept is succesful it returns a m socket descriptor newsockfd include ltsyssockethgt int accept int 50 kfd const struct sockaddr 139 ruddy socklenit 1111 1911 Returns nonnegative descriptor if OK1 if error communication communication endpoint endpoint U socket socket D ECS 1525 Computer Networks Demet Aksoy Connecf Fu ncTion 39nmvect function is used by a TCP client to establish a connection with a TCP server connectionoriented TCP 0 uses a socket descriptor sockfd created by the socket function 0 uses IP address and port number of the server servad I 39onnecl mcnon include ltsyssockethgt int connectint mckjt const struct sockaddr Sm39raddr socklenit Id1011 Returns 0 if OK1 if error ECS 1525 Computer Networks Demet Aksoy 20 Connecf Fu ncTion Clienm need not call bind prior to connect 0 When connect is called then the kernel assigns an ephemeral port and the source IP if necessary rmnect function include ltsyssockethgt int connectint soc const struct sockaddr quotyenudd socklenit udl39lcn Returns 0 if OK1 if error ECS 1525 Computer Networks Demet Aksoy 21 Close Fu ncrion r 39Imv function is called to mark the socket as closed 0 mark as closed and immediately return to the process 0 the socket descriptor is no longer usable by the process 0 once TCP has sent data queued up to be sent to the other end normal TCP connection termination termination sequence takes place include ltsyssockethgt int close int stick I Returns 0 if OK1 if error ECS 1525 Computer Networks Demet Aksoy 22 Summary communication communication i i t endpo nt endpo n l SOCket SOCket l 1 server clien socke r Cr ea re a descrip ror connec r Ini ria re message exchange for connec rion bind Se r local IP address and por r of The sockeT lis ren Place The socke r in passive mode se r queue accep r Accep r The nex r incoming connec rion gcomople redk k 353535 mp e N Z Lim nvfiiit i mn Am th 23 Allocation of Port Numbers 1 3913 mu mun mm BSD BSD BSD reserved ephemeral I I I ports shun lived nonpr1v1hdged ports mu mu 49m 49152 65535 IAN A IAN A IAN wellknown registered 1mm 01 ports ports prlvate LANA Internet Amigned Numberx A uthority ECS 1525 Computer Networks met Aksoy Why Generic Socke r Address Used 1390 cas139 pain fers 1390 pro focal specific sfruc fures For instance kernel takes caller s pointer casm it to sockaddr and then looks at the value of sa to determine the type of the structure include ltsyssockethgt struct sockaddr uint87t sailen saifamilyit saifamily address family AFixxx char saidatal4 protocol specific address E i D mputth m Demet Ksoy Various Socke r Address S rr39ucfu r39es IPv4 IPv6 sockaddr in len gm AFJNET 16bit pm IPv4 address owlabel unused xed length 154mg ECS 1525 Computer Networks Unix ockaddr un lengu1 AFiLOCAL up to 104 bytes interface index type we 1en addrlen sel len inter ce name an linklayer address variable length Demet Aksoy variable lengm Socke r API sockef an appca HOW cr eafed owned 05 d f explici rlr crea red confro e infer ace used To bofh send and use rieased receive messages OPP ICC Ions Tofrom a remofe or local upplicufion process controHed by C0quotquot dby application application developer develo er continued by 3323 by wequot quotquot9 infernef system r Chem server ECS 1525 Computer Networks Demet Aksoy Lecture 3 Network Layer Pr39ev summary IP packe r swi rched H Link layer W Today39s lec l39ur39e Ne rwor k Layer ECS 1525 Computer Networks Demet Aksoy 1 Network Layer Functions l path determination route taken by packets from source to dest Pouring algorithms forwarding move packets from router39s input to appropriate router output call setup some network rchitectures requir router call setup along path before data flows not Internet ECS 1525 Computer Networks Demet Aksoy 2 Internet Protocol Functionality Determine how to route packets from source to destination Hide the details of the physical network Unnliabic connectionlcss datagmm delivery To be studied Routing Addressing ARP ICMP and IGMP ECS 1525 Computer Networks Demet Aksoy 3 The Infernal NeTwor k layer Transport layer TCP UDP I Routing protocols atli selection Nefwor k IPOSPF BGP 6quot IP pnoiocoi 39addressing conveniions doiognoin fonmoi 39packet handling conveniions lay K ICMP pnoiocoi error repor rig outer u 39 Link layer physical layer ECS 1525 Computer Networks Demet Aksoy 4 Rou ring Routing pr o rocol Goal defermine good afh sequence of r oufers fhru network from source To desf Graph abstraction for r oufing r ifhms l graph nodes are roufer s l graph edges are physical links link cost delay cost or congesfion level ECS 1525 Computer Networks good pa rh Typically means minimum cost path other def39s possible Demet Aksoy Routing Algorithm classification Static or dynamic Global or decentralized Static 39quot ormallor I routes change slowly over Global Time I all routers have complete Dynamlc topology lInk cost Info u I routes change more quickly lInk state algorIthms Decentralized 39 Famed Pdale I rower knows Ph Sicully I in response to link cost connected neig h ors link Changes costs to neigh ors I iterative process of computation exchange of 39 h neighbors I distance vectorquot algorithms ECS 1525 Computer Networks Demet Aksoy 5 A LinkState Routing A Dijk ECS 1525 Computer Networks Iggo r I th m ra39s algorithm net topology link costs known to all nodes accomplished via link state ro dcastquot all nodes have same info computes least cost paths from one node sourcequot to all other as gives F Ou39lng table for that node iterative after k iterations know least cost path to k dest39s Demet Aksoy Notation cuj link cost from node i to j cost infinite if not direct neig Div current value of cost of path from source to dest V DWI predecessor node along path from source to v that is next v N set of nodes whose least cost path definitively known Dijskfr a39s Algor iThm 1 Initialization 3 for all nodes v 4 ifv adjacent to A 5 then Dv cAv 6 else Dv in y 7 8 Loop 9 nd w not in N such that Dw is a minimum 10 N 11 update Dv for all v adjacent to w and not in N 12 Dv min Dv Dw cwv 13 new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v 15 until all nodes in N ECS 1525 Computer Networks Demet Aksoy Dijksfr a39s algor ifhm example Step stanN DBpB DCpC DDpD DE21p E2 DFpF o A 2A 5A 1A in nlx infinity ECS 1525 Computer Networks Demet Aksoy 9 Dijksfr a39s algor ifhm example Step stanN DBpB DCPC DDPD DE21P E2 DFDF 0 A 2A 5A 1A in nity infinity 1 AD 2A 4D 2D infinity ECS 1525 Computer Networks Demet Aksoy 10 Dijkstra s algorithm example Step startN DBpB DCpC DDpD DE21p E2 DFpF o A 2A 5A 1A in m39 f It infinity 1 AD 2A 4D 2D infinity 2 ADB 4D infinity ECS 1525 Computer Networks Demet Aksoy 11 Dijksfr a39s algor ifhm example ECS 1525 Computer Networks Demet Aksoy 12 Dijksfr a39s algor ifhm example ECS 1525 Computer Networks Demet Aksoy 13 Distance Vector39 Routing Algorithm distributed each node communicates only with directlyattached neighbors iterative continues until no nodes exchange info selfterminating no quotsignalquot to stop asynchronous nodes need not exchange infoiterate in lock step ECS 1525 Computer Networks Demet Aksoy Distance Vector Routing Algorithm Distance Table data structures each node has its own routing table row for each possible destination column for each directlyattached neighbor to no e eg in node X for dest Y via neighbor Z distance fromX to Y via Z as next hop X D YZ Z cXZminVD Yw ECS 1525 Computer Networks Demet Aksoy 15 DisTcmce VecTor Algor iThm At all nodes X 1 Initialization 2 for all adjacent nodes v 3 DX v in y the operator means quotfor all rowsquot 4 D vv cXv 5 for all destinatiens y 6 send minWD yw to each neighbor w over all X39s neighbors ECS 1525 Computer Networks Demet Aksoy


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Allison Fischer University of Alabama

"I signed up to be an Elite Notetaker with 2 of my sorority sisters this semester. We just posted our notes weekly and were each making over $600 per month. I LOVE StudySoup!"

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.