CT 320: Network and System Administration Fall 2014 * Dr. Indrajit Ray Department of Computer Science Colorado State University Fort Collins, CO 80528, USA Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014 * Thanks to Dr. James Walden, NKU and Russ Wakefield, CSU for contents of these slides
Introduction to TCP/IP Networking Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Internetworking Internetwork = Collection of networks connected via routers Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Internet = Virtual Network Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Some Very Basic Terms My Laptop - Running web browser Web Server My laptop and the web server are both End Systems = Hosts End systems can also include PDAs, sensors, cell phones, and generally any device using the network to communicate End systems are located at the network edge and connected to the network using communication links Simple Example: Use web browser to lookup Internet Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
More Basic Terms: Client/Server My Laptop - Running web browser Web Server End systems may be classified as client, a server, both, or neither. Client – (runs) some program that requests services: web browser requests a page, reader requests messages, ftp program requests files, etc. Server – (runs) some program that listens for requests and provides services web server, server, ftp server, etc. Client vs. server depends on what programs the end system is running. Simple Example: Use web browser to lookup Internet Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Sending a packet from Argon to Neon Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Sending a packet from Argon to Neon DNS: The IP address of “neon.tcpip-lab.edu” is ARP: What is the MAC address of ? DNS: What is the IP address of “neon.tcpip-lab.edu”? ARP: The MAC address of is 00:e0:f9:23:a8: is not on my local network. Therefore, I need to send the packet to my default gateway with address frame is on my local network. Therefore, I can send the packet directly. ARP: The MAC address of is 00:20:af:03:98:28 ARP: What is the MAC address of ? frame Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Communications Architecture The complexity of the communication task is reduced by using multiple protocol layers: Each protocol is implemented independently Each protocol is responsible for a specific subtask Protocols are grouped in a hierarchy A structured set of protocols is called a communications architecture or protocol suite Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
TCP/IP Protocol Suite The TCP/IP protocol suite is the protocol architecture of the Internet The TCP/IP suite has four layers: Application, Transport, Network, and Data Link Layer End systems (hosts) implement all four layers. Gateways (Routers) only have the bottom two layers. Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
OSI and TCP/IP Protocol Stack OSI ModelTCP/IP HierarchyProtocols 7 th Application Layer 6 th Presentation Layer 5 th Session Layer 4 th Transport Layer 3 rd Network Layer 2 nd Link Layer 1 st Physical Layer Application Layer Transport Layer Network Layer Link Layer Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Functions of the Layers Data Link Layer: – Service: Reliable transfer of frames over a link Media Access Control on a LAN – Functions: Framing, media access control, error checking Network Layer: – Service: Move packets from source host to destination host – Functions: Routing, addressing Transport Layer: – Service: Delivery of data between hosts – Functions: Connection establishment/termination, error control, flow control Application Layer: – Service: Application specific (delivery of , retrieval of HTML documents, reliable transfer of file) – Functions: Application specific Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Assignment of Protocols to Layers Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Layered Communications An entity of a particular layer can only communicate with: 1. a peer layer entity using a common protocol (Peer Protocol) 2. adjacent layers to provide services and to receive services Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Layered Communications A layer N+1 entity sees the lower layers only as a service provider Service Provider N+1 Layer Entity N+1 Layer Peer Protocol Request Delivery Indicate Delivery Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Application View of Networking Application job: write the web browser (client) or web server (server) My Laptop - Running web browser Web Server Internet Assume network provides way to send a messages between hosts. Don’t know or care how the messages are sent. Do care about: Does the network provide a connection or is it connectionless? Are messages reliable? Who/what provides flow control? (speed of sending messages) Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Transport View of Networking Some Source End System Some Destination End System Transport job: design/implement the connection-oriented(-less) service Internet Assume application handles message content.. Don’t know or care about the content of the messages. Don’t know or care how the messages get from source to destination Do care about: How to provide a connection or connectionless service? How to make the transport connection reliable? How to handle congestion and flow control in the network? Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Network Layer View Network layer job: get a message from a source to a destination ISP B Assume higher layers handle message content, congestion(?), reliability Do care about: How to provide a best effort attempt to delivery packets? Routing! ISP A Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Link Layer View of Networking Link Layer job: get a message sent across some medium Only care about how to get message from A to B across this link Link can be twisted pair, coaxial, fiber optic, wireless Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Service Access Points A service user accesses services of the service provider at Service Access Points (SAPs) A SAP has an address that uniquely identifies where the service can be accessed Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Exchange of Data The unit of data sent between peer entities is called a Protocol Data Unit (PDU) For now, let us think of a PDU as a single packet Scenario: Layer-N at A sends a layer-N PDU to layer-N at B What actually happens: – A ’ s layer-N passes the PDU to the SAPs at layer-N-1 – Layer-N-1 entity at A constructs its own (layer-N-1) PDU which it sends to the layer-N-1 entity at B – PDU at layer-N-1 = layer-N-1 Header + layer –N PDU AB Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Exchange of Data AB Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Layers in the Example Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Layers in the Example Send HTTP Request to neon Establish a connection to at port 80 Open TCP connection to port 80 Send a datagram (which contains a connection request) to Send IP datagram to Send the datagram to Send Ethernet frame to 00:e0:f9:23:a8:20 Send Ethernet frame to 00:20:af:03:98:28 Send IP data-gram to Send the datagram to Frame is an IP datagram IP datagram is a TCP segment for port 80 Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Layers and Services Service provided by TCP to HTTP: – reliable transmission of data over a logical connection Service provided by IP to TCP: – unreliable transmission of IP datagrams across an IP network Service provided by Ethernet to IP: – transmission of a frame across an Ethernet segment Other services: – DNS: translation between domain names and IP addresses – ARP: Translation between IP addresses and MAC addresses Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Encapsulation As data is moving down the protocol stack, each protocol is adding layer-specific control information Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Ethernet Computer Computer communication on same network Each device has unique MAC address (48-bit) example: 00-C0-4F Ethernet Packet: Dest. address DataCRC Source address Type MAC: Media Access Control 6bytes 2bytes Preamble 8bytes bytes4bytes Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
IP: Internet Protocol Unreliable … connectionless datagram delivery service Responsible for routing of data through intermediate networks and computers IP header: 1 :ICMP 6 :TCP 17 :UDP Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
IP Routing Routing Table Destination IP address IP address of a next-hop router Flags Network interface specification Application Transport Network Link Application Transport Network Link Network Link Source Destination Router Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
ICMP : Internet Control Message Protocol Used to report problems with delivery of IP Datagrams within an IP network Used by Ping, Traceroute commands Types and Codes Echo Request (type=8, code=0) Echo Reply(type=0, code=0) Destination Unreachable(type=3, code=0) Time Exceeded(type=11, code=0) : Time-to-Live =0 ICMP Message ICMP Data ICMP Header IP Header 4bytes20bytes TypeCodeChecksum 1byte 2bytes Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
TCP : Transmission Control Protocol Connection-Oriented, Reliable, Byte Stream Service Protocol 1.Set up connection 2.Transfer data 3.Close connection Source PortDestination Port Sequence Number Acknowledgement Number Data Offset ---- Window ChecksumUrgent Pointer Options (0 to 10 Words of 32 Bits) TCP Payload TCP Header Format Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
IP Addressing: Introduction IP address: 32-bit identifier for host, router interface interface: connection between host/router and physical link – router’s typically have multiple interfaces – host may have multiple interfaces – IP addresses associated with each interface = Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
An Addressing Example Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
IP Addresses 4 8-bit numbers (Hierarchical) Specifies both network and host Number of bits allocated to specify network varies Three classes: 0 net host bits 110 net host bits 1 0 net host bits ABC network 32-bits host Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
IP Addresses IP (Version 4) Addresses are 32 bits long IP Addresses Assigned Statically or Dynamically (DHCP) IPv6 addresses are 128 bits long Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
IP Address Space Originally, 3 Classes – A, B, C Problem – Classes too rigid (C too small, B too big) Solution – Subnetting (e.g. within CSU) – Classless Interdomain Routing (CIDR) Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Subnetting IP Address plus subnet mask (netmask) IP Addr: Netmask: 0xFFFFFF00 ( ) – First 24 bits are the Subnet ID (the neighborhood) – Last 8 bits are Host ID (the street address) Can be written as “ Prefix + Length ” – /24 or /24 Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Subnets IP address: – subnet part (high order bits) – host part (low order bits) What’s a subnet ? – device interfaces with same subnet part of IP address – can physically reach each other without intervening router network consisting of 3 subnets LAN Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Subnets Recipe To determine the subnets, detach each interface from its host or router, creating islands of isolated networks. Each isolated network is called a subnet / / /24 Subnet mask: /24 Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Subnets Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Routers and IP Addressing Principle Routers have two or more addresses – one for each interface. Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
IP Addressing: CIDR CIDR: Classless Inter Domain Routing – subnet portion of address of arbitrary length – address format: a.b.c.d/x, where x is # bits in subnet portion of address subnet part host part /23 Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Getting a datagram from source to dest. IP datagram: A B E misc fields source IP addr dest IP addr data r datagram remains unchanged, as it travels source to destination r addr fields of interest here Dest. Net. next router Nhops routing table in A Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Getting a datagram from source to dest A B E Starting at A, given IP datagram addressed to B: r look up net. address of B r find B is on same net. as A r link layer will send datagram directly to B inside link-layer frame m B and A are directly connected Dest. Net. next router Nhops misc fields data Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Getting a datagram from source to dest A B E Dest. Net. next router Nhops Starting at A, dest. E: r look up network address of E r E on different network m A, E not directly attached r routing table: next hop router to E is r link layer sends datagram to router inside link-layer frame r datagram arrives at r continued….. misc fields data Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
Getting a datagram from source to dest A B E Arriving at , destined for r look up network address of E r E on same network as router’s interface m router, E directly attached r link layer sends datagram to inside link-layer frame via interface r datagram arrives at !!! (hooray!) misc fields data network router Nhops interface Dest. next Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
ARP : Address Resolution Protocol ARP provides mapping 32bit IP address 48bit MAC address C0-4F ARP cache maintains the recent mappings from IP addresses to MAC addresses Protocol 1.ARP request broadcast on Ethernet 2.Destination host ARP layer responds Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014
IP addresses: Allocation Q: How does a host get an IP address? hard-coded by system admin in a file – Wintel: control-panel->network->configuration- >tcp/ip->properties – UNIX: /etc/rc.config DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server – “plug-and-play” Dr. Indrajit Ray, Computer Science Department CT 320 – Network and Systems Administration, Fall 2014