CSCE 790 Internet Security Lecture 2 TCP/IP
Reading Assignment <ul><li>Reading assignments for January 17 : </li></ul><ul><li>Required: </li></ul><ul><ul><li>Oppliger...
Before Internet <ul><li>Isolated, local packet-switching networks  </li></ul><ul><ul><li>only nodes on the same network co...
Before Internet (cont) <ul><li>ARPANET: sponsored by Defense Advanced Research Projects  </li></ul><ul><li>Agency (DARPA):...
Internet <ul><li>Connect Existing Networks: </li></ul><ul><li>ARPANET, Packet Radio, and Packet Satellite </li></ul><ul><l...
Goals (Clark’88) <ul><li>Connect existing networks </li></ul><ul><li>Survivability </li></ul><ul><li>Support multiple type...
Internet Challenge <ul><li>Interconnected networks differ (protocols, interfaces, services, etc.) </li></ul><ul><li>Soluti...
Layering <ul><li>Organize a network system  into logically distinct entities </li></ul><ul><ul><li>the service provided by...
Without Layering <ul><li>Each application has to be implemented for every network technology! </li></ul>SMTP  FTP HTTP Coa...
With Layering <ul><li>Intermediate layer provides a unique abstraction for various network technologies </li></ul>SMTP  FT...
Layering <ul><li>Advantages </li></ul><ul><ul><li>Modularity – protocols easier to manage and maintain </li></ul></ul><ul>...
ISO OSI Reference Model <ul><li>ISO – International Standard Organization </li></ul><ul><li>OSI – Open System Interconnect...
ISO OSI Reference Model <ul><li>Seven layers </li></ul><ul><ul><li>Lower three layers are peer-to-peer </li></ul></ul><ul>...
Data Transmission <ul><li>A layer can use only the service provided by the layer immediate below it </li></ul><ul><li>Each...
OSI Model Concepts <ul><li>Service – says what a layer does </li></ul><ul><li>Interface – says how to access the service  ...
Physical Layer (1) <ul><li>Service: move the information between two systems connected by a physical link </li></ul><ul><l...
Datalink Layer (2) <ul><li>Service:  </li></ul><ul><ul><li>framing, i.e., attach frames separator  </li></ul></ul><ul><ul>...
Network Layer (3) <ul><li>Service:  </li></ul><ul><ul><li>deliver a packet to specified destination </li></ul></ul><ul><ul...
Transport Layer (4) <ul><li>Service:  </li></ul><ul><ul><li>provide an error-free and flow-controlled end-to-end connectio...
Session Layer (5) <ul><li>Service: </li></ul><ul><ul><li>full-duplex </li></ul></ul><ul><ul><li>access management, e.g., t...
Presentation Layer (6) <ul><li>Service: convert data between various representations </li></ul><ul><li>Interface: depends ...
Application Layer (7) <ul><li>Service: any service provided to the end user </li></ul><ul><li>Interface: depends on the ap...
TCP/IP Networking Model <ul><li>TCP/IP has a different layered model </li></ul><ul><li>Network Access Layer </li></ul><ul>...
Network Access Layer <ul><li>Responsible for physical connection </li></ul><ul><ul><li>Shape </li></ul></ul><ul><ul><li>Si...
Internet Layer <ul><li>Transports data from one end-user system to another end-user systems by hopping across as many phys...
IP Header <ul><li>Comments </li></ul><ul><ul><li>HLen – header length only in 32-bit words (5 <= HLen <= 15) </li></ul></u...
IP Addresses <ul><li>IP provides logical address space and a corresponding addressing schema </li></ul><ul><li>IP address ...
Routing Protocols <ul><li>Enable routing decisions to be made </li></ul><ul><li>Manage and periodically update routing  ta...
Supporting Protocols <ul><li>Handle specific tasks </li></ul><ul><ul><li>Address Resolution Protocol (ARP) </li></ul></ul>...
The Domain Name System <ul><li>Each system connected to the Internet also has one or more logical addresses. </li></ul><ul...
Domain Name Resolution <ul><li>Domain Name Resolution:  looking up a logical name and finding a physical IP address  </li>...
Transport Layer (TCP) <ul><li>Present a reliable end-to-end pipe to the application </li></ul><ul><li>Data either arrives ...
TCP Header <ul><li>Sequence number, acknowledgement, and advertised window – used by sliding-window based flow control </l...
TCP Header (Cont) <ul><li>Checksum – 1’s complement and is computed over </li></ul><ul><ul><li>TCP header </li></ul></ul><...
TCP Connection Establishment <ul><li>Three-way handshake </li></ul><ul><ul><li>Goal: agree on a set of parameters: the sta...
Application Layer <ul><li>Uses the reliable TCP connections to accomplish useful work over the network </li></ul><ul><ul><...
OSI vs. TCP/IP <ul><li>OSI: conceptually define: service, interface, protocol </li></ul><ul><li>Internet: provide a succes...
Upcoming SlideShare
Loading in …5
×

TCP/IP

1,512 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,512
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
103
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

TCP/IP

  1. 1. CSCE 790 Internet Security Lecture 2 TCP/IP
  2. 2. Reading Assignment <ul><li>Reading assignments for January 17 : </li></ul><ul><li>Required: </li></ul><ul><ul><li>Oppliger: Ch 1. Terminology, Ch 2. TCP/IP Networking </li></ul></ul><ul><ul><li>Max. Sec.: Part II, Ch 4: A brief primer on TCP/IP </li></ul></ul><ul><li>Additional: </li></ul><ul><ul><li>Internet Society (ISOC) homepage ( http://www.isoc.org ) </li></ul></ul><ul><ul><li>Some of my slides originated from lecture notes of Ion Stoica ( http://www.cs.berkeley.edu/~istoica/cs268/ ) and lecture notes of Charles Severance ( http://www.netfact.com/crs/school/cps291int/techtcp/ ) on networking and TCP/IP </li></ul></ul><ul><li>Reading assignments for January 22 : </li></ul><ul><li>Required: </li></ul><ul><ul><li>Oppliger: Ch 3. Attacks </li></ul></ul>
  3. 3. Before Internet <ul><li>Isolated, local packet-switching networks </li></ul><ul><ul><li>only nodes on the same network could communicate </li></ul></ul><ul><li>Each network is autonomous: </li></ul><ul><ul><li>different services </li></ul></ul><ul><ul><li>different interfaces </li></ul></ul><ul><ul><li>different protocols </li></ul></ul>
  4. 4. Before Internet (cont) <ul><li>ARPANET: sponsored by Defense Advanced Research Projects </li></ul><ul><li>Agency (DARPA): </li></ul><ul><li>1969: interconnected 4 hosts </li></ul><ul><li>1970: host-to-host protocol: Network Control Protocol (NCP) </li></ul><ul><li>1972: first application: e-mail </li></ul>Univ. of California at LA (UCLA) Stanford Research Institute (SRI) Univ. of California at Santa Barbara (UCSB) Univ. of Utah
  5. 5. Internet <ul><li>Connect Existing Networks: </li></ul><ul><li>ARPANET, Packet Radio, and Packet Satellite </li></ul><ul><li>NCP not sufficient  Develop new protocol </li></ul><ul><li>1970s: Transmission Control Protocol (Kahn and Vinton) </li></ul><ul><ul><li>Based on packet switching technology </li></ul></ul><ul><ul><li>Good for file transfer and remote terminal access </li></ul></ul><ul><li>Divide TCP into 2 protocols </li></ul><ul><ul><li>Internet Protocol (IP): addressing and forwarding of packets </li></ul></ul><ul><ul><li>Transmission Control Protocol (TCP): sophisticated services, e.g. flow control, recovery </li></ul></ul><ul><li>1980: TCP/IP adopted as a DoD standard </li></ul><ul><li>1983: ARPANET protocol officially changed from NCP to TCP/IP </li></ul><ul><li>1985: Existing Internet technology </li></ul><ul><li>1995: U.S. Federal Networking Council (FNC) define the term Internet </li></ul>
  6. 6. Goals (Clark’88) <ul><li>Connect existing networks </li></ul><ul><li>Survivability </li></ul><ul><li>Support multiple types of services </li></ul><ul><li>Must accommodate a variety of networks </li></ul><ul><li>Allow distributed management </li></ul><ul><li>Allow host attachment with a low level of effort </li></ul><ul><li>Be cost effective </li></ul><ul><li>Allow resource accountability </li></ul>
  7. 7. Internet Challenge <ul><li>Interconnected networks differ (protocols, interfaces, services, etc.) </li></ul><ul><li>Solutions: </li></ul><ul><ul><li>Reengineer and develop one global packet switching network standard: not economically feasible </li></ul></ul><ul><ul><li>Have every host implement the protocols of any network it wants to communicate with: too complex, very high engineering cost </li></ul></ul><ul><ul><li>Add an extra layer: internetworking layer </li></ul></ul><ul><ul><ul><li>Hosts: one higher-level protocol </li></ul></ul></ul><ul><ul><ul><li>Network connecting use the same protocol </li></ul></ul></ul><ul><ul><ul><li>Interface between the new protocol and network </li></ul></ul></ul>
  8. 8. Layering <ul><li>Organize a network system into logically distinct entities </li></ul><ul><ul><li>the service provided by one entity is based only on the service provided by the lower level entity </li></ul></ul>
  9. 9. Without Layering <ul><li>Each application has to be implemented for every network technology! </li></ul>SMTP FTP HTTP Coaxial cable Fiber optic Application Transmission Media
  10. 10. With Layering <ul><li>Intermediate layer provides a unique abstraction for various network technologies </li></ul>SMTP FTP Coaxial cable Fiber optic Application Transmission Media Intermediate layer HTTP
  11. 11. Layering <ul><li>Advantages </li></ul><ul><ul><li>Modularity – protocols easier to manage and maintain </li></ul></ul><ul><ul><li>Abstract functionality –lower layers can be changed without affecting the upper layers </li></ul></ul><ul><ul><li>Reuse – upper layers can reuse the functionality provided by lower layers </li></ul></ul><ul><li>Disadvantages </li></ul><ul><ul><li>Information hiding – inefficient implementations </li></ul></ul>
  12. 12. ISO OSI Reference Model <ul><li>ISO – International Standard Organization </li></ul><ul><li>OSI – Open System Interconnection </li></ul><ul><li>Goal: a general open standard </li></ul><ul><ul><li>allow vendors to enter the market by using their own implementation and protocols </li></ul></ul>
  13. 13. ISO OSI Reference Model <ul><li>Seven layers </li></ul><ul><ul><li>Lower three layers are peer-to-peer </li></ul></ul><ul><ul><li>Next four layers are end-to-end </li></ul></ul>Application Presentation Session Transport Network Datalink Physical Application Presentation Session Transport Network Datalink Physical Network Datalink Physical Physical medium
  14. 14. Data Transmission <ul><li>A layer can use only the service provided by the layer immediate below it </li></ul><ul><li>Each layer may change and add a header to data packet </li></ul>Data Data Data Data Data Data Data Data Data Data Data Data Data Data
  15. 15. OSI Model Concepts <ul><li>Service – says what a layer does </li></ul><ul><li>Interface – says how to access the service </li></ul><ul><li>Protocol – says how is the service implemented </li></ul><ul><ul><li>a set of rules and formats that govern the communication between two peers </li></ul></ul>
  16. 16. Physical Layer (1) <ul><li>Service: move the information between two systems connected by a physical link </li></ul><ul><li>Interface: specifies how to send a bit </li></ul><ul><li>Protocol: coding scheme used to represent a bit, voltage levels, duration of a bit </li></ul><ul><li>Examples: coaxial cable, optical fiber links; transmitters, receivers </li></ul>
  17. 17. Datalink Layer (2) <ul><li>Service: </li></ul><ul><ul><li>framing, i.e., attach frames separator </li></ul></ul><ul><ul><li>send data frames between peers </li></ul></ul><ul><ul><li>others: </li></ul></ul><ul><ul><ul><li>arbitrate the access to common physical media </li></ul></ul></ul><ul><ul><ul><li>ensure reliable transmission </li></ul></ul></ul><ul><ul><ul><li>provide flow control </li></ul></ul></ul><ul><li>Interface: send a data unit (packet) to a machine connected to same physical media </li></ul><ul><li>Protocol: layer addresses, implement Medium Access Control (MAC) (e.g., CSMA/CD)… </li></ul>
  18. 18. Network Layer (3) <ul><li>Service: </li></ul><ul><ul><li>deliver a packet to specified destination </li></ul></ul><ul><ul><li>perform segmentation/reassemble </li></ul></ul><ul><ul><li>others: </li></ul></ul><ul><ul><ul><li>packet scheduling </li></ul></ul></ul><ul><ul><ul><li>buffer management </li></ul></ul></ul><ul><li>Interface: send a packet to a specified destination </li></ul><ul><li>Protocol: define global unique addresses; construct routing tables </li></ul>
  19. 19. Transport Layer (4) <ul><li>Service: </li></ul><ul><ul><li>provide an error-free and flow-controlled end-to-end connection </li></ul></ul><ul><ul><li>multiplex multiple transport connections to one network connection </li></ul></ul><ul><ul><li>split one transport connection in multiple network connections </li></ul></ul><ul><li>Interface: send a packet to specify destination </li></ul><ul><li>Protocol: implement reliability and flow control </li></ul><ul><li>Examples: TCP and UDP </li></ul>
  20. 20. Session Layer (5) <ul><li>Service: </li></ul><ul><ul><li>full-duplex </li></ul></ul><ul><ul><li>access management, e.g., token control </li></ul></ul><ul><ul><li>synchronization, e.g., provide check points for long transfers </li></ul></ul><ul><li>Interface: depends on service </li></ul><ul><li>Protocols: token management; insert checkpoints, implement roll-back functions </li></ul>
  21. 21. Presentation Layer (6) <ul><li>Service: convert data between various representations </li></ul><ul><li>Interface: depends on service </li></ul><ul><li>Protocol: define data formats, and rules to convert from one format to another </li></ul>
  22. 22. Application Layer (7) <ul><li>Service: any service provided to the end user </li></ul><ul><li>Interface: depends on the application </li></ul><ul><li>Protocol: depends on the application </li></ul><ul><li>Examples: FTP, Telnet, WWW browser </li></ul>
  23. 23. TCP/IP Networking Model <ul><li>TCP/IP has a different layered model </li></ul><ul><li>Network Access Layer </li></ul><ul><ul><li>Physical Connection </li></ul></ul><ul><ul><li>LAN Connection </li></ul></ul><ul><li>Internetwork Layer (IP) </li></ul><ul><ul><li>WAN Connectivity </li></ul></ul><ul><ul><li>Unreliable Datagram Service </li></ul></ul><ul><li>Transport Layer (TCP) </li></ul><ul><ul><li>Error Correction </li></ul></ul><ul><ul><li>Reliable Connection </li></ul></ul>Application Layer
  24. 24. Network Access Layer <ul><li>Responsible for physical connection </li></ul><ul><ul><li>Shape </li></ul></ul><ul><ul><li>Size </li></ul></ul><ul><ul><li>Voltages </li></ul></ul><ul><li>Responsible for rules of how to put bits on the “wire” </li></ul><ul><li>These are the building blocks for the network </li></ul><ul><li>The goal of the physical layer is to move information across one “hop” </li></ul>
  25. 25. Internet Layer <ul><li>Transports data from one end-user system to another end-user systems by hopping across as many physical connections as necessary </li></ul><ul><li>Provides a mechanism to connect many LANs together effectively </li></ul><ul><li>Connectionless and unreliable datagram protocol </li></ul><ul><li>Protocols: </li></ul><ul><ul><li>Internet Protocol </li></ul></ul><ul><ul><li>Routing Protocol </li></ul></ul><ul><ul><li>Supporting Protocol </li></ul></ul>
  26. 26. IP Header <ul><li>Comments </li></ul><ul><ul><li>HLen – header length only in 32-bit words (5 <= HLen <= 15) </li></ul></ul><ul><ul><li>TOS (Type of Service): now split in </li></ul></ul><ul><ul><ul><li>Differentiated Service Field (6 bits) </li></ul></ul></ul><ul><ul><ul><li>remaining two bits used by ECN (Early Congestion Notification) </li></ul></ul></ul><ul><ul><li>Length – the length of the entire datagram/segment; header + data </li></ul></ul><ul><ul><li>Flags: Don’t Fragment (DF) and More Fragments (MF) </li></ul></ul><ul><ul><li>Fragment offset – all fragments excepting last one contain multiples of 8 bytes </li></ul></ul><ul><ul><li>Header checksum - uses 1’s complement </li></ul></ul>Version HLen TOS Length Identification Fragment offset Flags Source address Destination address TTL Protocol Header checksum 0 4 8 16 19 31 Options (variable) 20 bytes
  27. 27. IP Addresses <ul><li>IP provides logical address space and a corresponding addressing schema </li></ul><ul><li>IP address is a globally unique or private number associated with a host network interface </li></ul><ul><li>Every system which will send packets directly out across the Internet must have a unique IP address </li></ul><ul><li>IP addresses are based on where station is connected </li></ul><ul><li>IP addresses are controlled by a single organization - address ranges are assigned </li></ul><ul><li>They are running out of space! </li></ul>
  28. 28. Routing Protocols <ul><li>Enable routing decisions to be made </li></ul><ul><li>Manage and periodically update routing tables, stored at each router </li></ul><ul><li>Autonomous collection of routers: </li></ul><ul><ul><li>Under single administration </li></ul></ul><ul><ul><li>Use same routing protocol: Interior Gateway Protocol (IGP) </li></ul></ul><ul><ul><li>Use Exterior Gateway Protocol (EGP) to communicate other systems </li></ul></ul><ul><li>Router : “which way” to send the packet closer. (Keep routing table small and allow to handle unlimited number of systems.) </li></ul><ul><li>Protocol types: </li></ul><ul><ul><li>Reachability </li></ul></ul><ul><ul><li>Distance vector </li></ul></ul>
  29. 29. Supporting Protocols <ul><li>Handle specific tasks </li></ul><ul><ul><li>Address Resolution Protocol (ARP) </li></ul></ul><ul><ul><li>Reverse Address Resolution Protocol (RARP) </li></ul></ul><ul><ul><li>Internet Control Message Protocol (ICMP) </li></ul></ul><ul><ul><li>Internet Group Management Protocol (IGMP) </li></ul></ul>
  30. 30. The Domain Name System <ul><li>Each system connected to the Internet also has one or more logical addresses. </li></ul><ul><li>Unlike IP addresses, the domain address have no routing information - they are organized based on administrative units </li></ul><ul><li>There are no limitations on the mapping from domain addresses to IP addresses </li></ul>
  31. 31. Domain Name Resolution <ul><li>Domain Name Resolution: looking up a logical name and finding a physical IP address </li></ul><ul><li>There is a hierarchy of domain name servers </li></ul><ul><li>Each client system uses one domain name server which in turn queries up and down the hierarchy to find the address </li></ul><ul><li>If your server does not know the address, it goes up the hierarchy possibly to the top and works its way back down </li></ul>
  32. 32. Transport Layer (TCP) <ul><li>Present a reliable end-to-end pipe to the application </li></ul><ul><li>Data either arrives in the proper order or the connection is closed </li></ul><ul><li>Keeps buffers in the sending and destination system to keep data which has arrived out of order or to retransmit if necessary </li></ul><ul><li>Provides individual connections between applications </li></ul>
  33. 33. TCP Header <ul><li>Sequence number, acknowledgement, and advertised window – used by sliding-window based flow control </li></ul><ul><li>Flags: </li></ul><ul><ul><li>SYN, FIN – establishing/terminating a TCP connection </li></ul></ul><ul><ul><li>ACK – set when Acknowledgement field is valid </li></ul></ul><ul><ul><li>URG – urgent data; Urgent Pointer says where non-urgent data starts </li></ul></ul><ul><ul><li>PUSH – don’t wait to fill segment </li></ul></ul><ul><ul><li>RESET – abort connection </li></ul></ul>Source port Destination port Options (variable) Sequence number Acknowledgement Advertised window Checksum Urgent pointer Flags HdrLen 0 4 10 16 31
  34. 34. TCP Header (Cont) <ul><li>Checksum – 1’s complement and is computed over </li></ul><ul><ul><li>TCP header </li></ul></ul><ul><ul><li>TCP data </li></ul></ul><ul><ul><li>Pseudo-header (from IP header) </li></ul></ul><ul><ul><ul><li>Note: breaks the layering! </li></ul></ul></ul>Source address Destination address TCP Segment length 0 Protocol (TCP)
  35. 35. TCP Connection Establishment <ul><li>Three-way handshake </li></ul><ul><ul><li>Goal: agree on a set of parameters: the start sequence number for each side </li></ul></ul>Client (initiator) Server SYN, SeqNum = x SYN and ACK, SeqNum = y and Ack = x + 1 ACK, Ack = y + 1
  36. 36. Application Layer <ul><li>Uses the reliable TCP connections to accomplish useful work over the network </li></ul><ul><ul><li>client-server applications </li></ul></ul><ul><ul><li>standard applications </li></ul></ul><ul><ul><ul><li>telnet (port 23) </li></ul></ul></ul><ul><ul><ul><li>mail (port 25) </li></ul></ul></ul><ul><ul><ul><li>finger (port 79) </li></ul></ul></ul><ul><ul><ul><li>ftp (port 21) </li></ul></ul></ul><ul><li>Each application uses a “port” and a protocol </li></ul><ul><li>Each port can have many connections </li></ul>
  37. 37. OSI vs. TCP/IP <ul><li>OSI: conceptually define: service, interface, protocol </li></ul><ul><li>Internet: provide a successful implementation </li></ul>Application Presentation Session Transport Network Datalink Physical Internet Host-to- network Transport Application IP LAN Packet radio TCP UDP Telnet FTP DNS

×