CSE 4471 Computer Network Review r Network Layers















![UDP: User Datagram Protocol [RFC 768] r “no frills, ” “bare bones” Internet transport UDP: User Datagram Protocol [RFC 768] r “no frills, ” “bare bones” Internet transport](https://slidetodoc.com/presentation_image_h/dfbe4592f9a906e281dee5080e85d682/image-16.jpg)













- Slides: 29

CSE 4471: Computer Network Review r Network Layers r TCP/UDP r IP r Ethernet

Internet Layers r application: supporting network applications m ftp, smtp, http r transport: host-host data transfer m tcp, udp r network: routing of datagrams from source to destination m ip, routing protocols r link: data transfer between neighboring network elements m application transport network link physical ppp, ethernet r physical: bits “on the wire” 2

OSI Network Layers

Layering: logical communication Each layer: r distributed r “entities” implement layer functions at each node r entities perform actions, exchange messages with peers application transport network link physical application transport network link physical 4

Layering: physical communication data application transport network link physical application transport network link physical data application transport network link physical 5

Protocol layering and data Each layer takes data from above r adds header information to create new data unit r passes new data unit to layer below source destination M application M message Ht M Hn Ht M Hl Hn Ht M transport segment network link Ht M Hn Ht M Hl Hn Ht M physical datagram frame 6

Internet structure: network of networks r roughly hierarchical r national/international local ISP backbone providers (NBPs) m m e. g. BBN/GTE, Sprint, AT&T, IBM, UUNet interconnect (peer) with each other privately, or at NAP public Network Access Point (NAPs) r regional ISPs m connect into NBPs r local ISP, company m connect into regional ISPs regional ISP NBP B NAP NBP A regional ISP local ISP 7

National Backbone Provider e. g. Sprint US backbone network 8

TCP r Transport Control Protocol r Flow control and Responds to congestion r Reliable In-order delivery r “Nice” Protocol

TCP segment structure 32 bits URG: urgent data (generally not used) ACK: ACK # valid PSH: push data now (generally not used) RST, SYN, FIN: connection estab (setup, teardown commands) Internet checksum (as in UDP) source port # dest port # sequence number acknowledgement number head not UA P R S F len used checksum rcvr window size ptr urgent data Options (variable length) application data (variable length) counting by bytes of data (not segments!) # bytes rcvr willing to accept

Reliable Delivery r Sender, Receiver keep track of bytes sent and bytes received. r Acks have an indication of next byte expected. r Three duplicate acks considered a packet loss sender retransmits

TCP seq. #’s and ACKs Seq. #’s: m byte stream “number” of first byte in segment’s data ACKs: m seq # of next byte expected from other side m cumulative ACK Q: how receiver handles outof-order segments m A: TCP spec doesn’t say, - up to implementer Host B Host A User types ‘C’ Seq=4 2, ACK = 79, da ta ata = d , 3 4 K= , AC q=79 Se host ACKs receipt of echoed ‘C’ = ‘C’ host ACKs receipt of ‘C’, echoes back ‘C’ Seq=4 3, ACK =80 simple telnet scenario time

TCP Flow Control r Window based r Sender cannot send more data than a window without acknowledgements. r Window is a minimum of receiver’s buffer and ‘congestion window’. r After a window of data is transmitted, in steady state, acks control sending rate.

Flow Control

UDP r No reliability, flow control, congestion control. r Sends data in a burst. r Provides multiplexing and demultiplexing of sources. r Most multimedia applications using UDP
![UDP User Datagram Protocol RFC 768 r no frills bare bones Internet transport UDP: User Datagram Protocol [RFC 768] r “no frills, ” “bare bones” Internet transport](https://slidetodoc.com/presentation_image_h/dfbe4592f9a906e281dee5080e85d682/image-16.jpg)
UDP: User Datagram Protocol [RFC 768] r “no frills, ” “bare bones” Internet transport protocol r “best effort” service, UDP segments may be: m lost m delivered out of order to app r connectionless: m no handshaking between UDP sender, receiver m each UDP segment handled independently of others Why is there a UDP? r no connection establishment (which can add delay) r simple: no connection state at sender, receiver r small segment header r no congestion control: UDP can blast away as fast as desired

UDP segment structure r often used for streaming multimedia apps m loss tolerant m rate sensitive Length, in bytes of UDP r other UDP uses (why? ): segment, including m DNS header m SNMP r reliable transfer over UDP: add reliability at application layer m application-specific error recover! 32 bits source port # dest port # length checksum Application data (message) UDP segment format

IP datagram format IP protocol version number header length (bytes) “type” of data max number remaining hops (decremented at each router) upper layer protocol to deliver payload to 32 bits type of ver head. len service length fragment 16 -bit identifier flgs offset time to upper Internet layer live checksum total datagram length (bytes) for fragmentation/ reassembly 32 bit source IP address 32 bit destination IP address Options (if any) data (variable length, typically a TCP or UDP segment) E. g. timestamp, record route taken, pecify list of routers to visit.

ICMP: Internet Control Message Protocol r used by hosts, routers, gateways to communication network-level information m error reporting: unreachable host, network, port, protocol m echo request/reply (used by ping) r network-layer “above” IP: m ICMP msgs carried in IP datagrams r ICMP message: type, code plus first 8 bytes of IP datagram causing error Type 0 3 3 3 4 Code 0 0 1 2 3 6 7 0 8 9 10 11 12 0 0 0 description echo reply (ping) dest. network unreachable dest host unreachable dest protocol unreachable dest port unreachable dest network unknown dest host unknown source quench (congestion control - not used) echo request (ping) route advertisement router discovery TTL expired bad IP header

Routing in the Internet r The Global Internet consists of Autonomous Systems (AS) interconnected with each other: m m m Stub AS: small corporation Multihomed AS: large corporation (no transit) Transit AS: provider r Two-level routing: m Intra-AS: administrator is responsible for choice: RIP, OSPF m Inter-AS: unique standard: BGP

Link Layer 21

Link Layer: setting the context r two physically connected devices: m host-router, router-router, host-host r unit of data: frame M Ht M Hn Ht M Hl Hn Ht M application transport network link physical data link protocol phys. link network link physical Hl Hn Ht M frame adapter card 22

Link Layer Services r Framing, link access: m encapsulate datagram into frame, adding header, trailer m implement channel access if shared medium, m ‘physical addresses’ used in frame headers to identify source, dest • different from IP address! r Reliable delivery between two physically connected devices: m m m we learned how to do this already (chapter 3)! seldom used on low bit error link (fiber, some twisted pair) wireless links: high error rates • Q: why both link-level and end-end reliability? 23

Link Layer Services (more) r Flow Control: m pacing between sender and receivers r Error Detection: m errors caused by signal attenuation, noise. m receiver detects presence of errors: • signals sender for retransmission or drops frame r Error Correction: m receiver identifies and corrects bit error(s) without resorting to retransmission 24

Multiple Access Links and Protocols Three types of “links”: r point-to-point (single wire, e. g. PPP, SLIP) r broadcast (shared wire or medium; e. g, Ethernet, Wavelan, etc. ) r switched (e. g. , switched Ethernet, ATM etc) 25

Multiple Access protocols r single shared communication channel r two or more simultaneous transmissions by nodes: interference m only one node can send successfully at a time r multiple access protocol: m distributed algorithm that determines how stations share channel, i. e. , determine when station can transmit m communication about channel sharing must use channel itself! m what to look for in multiple access protocols: • • synchronous or asynchronous information needed about other stations robustness (e. g. , to channel errors) performance 26

Ethernet: uses CSMA/CD A: sense channel, if idle then { transmit and monitor the channel; If detect another transmission then { abort and send jam signal; update # collisions; delay as required by exponential backoff algorithm; goto A } else {done with the frame; set collisions to zero} } else {wait until ongoing transmission is over and goto A} 27

A Summary on Network Layers and Their Vulnerabilities Network Layer Basic Functions Representative Protocols Security Vulnerability Examples Application Providing services such as WWW to end-users HTTP, SMTP, FTP Java. Script-based malware, Email spams Transport End-to-end message transmission independent of the underlying network TCP, UDP TCP SYN attack, UDP flooding attack Network Routing IP, ICMP, RIP, OSPF, BGP IP spoofing, Black hole attack to RIP Data Link Media access control Ethernet, Wi-Fi Eavesdropping attack Physical Transmitting raw bit stream Physical attack such as cut to cable 28

Acknowledgement r Part of the slides are from Kurose and Ross’s book “Computer Networking: A Top-Down Approach”. 29