TCP/IP networking 1-1
Upcoming SlideShare
Loading in...5

TCP/IP networking 1-1






Total Views
Views on SlideShare
Embed Views



1 Embed 1 1



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

TCP/IP networking 1-1 TCP/IP networking 1-1 Presentation Transcript

  • TCP/IP networking
    • TCP/IP
      • A networking protocol suite
        • Use several protocols, main ones are tcp and ip.
        • IP stands for Internet Protocol
        • TCP stands for Transmission Control Protocol.
      • The native language of the Internet
      • Supported by most OSs (Unix, MacOS, Windows, Netware, etc)
      • Defines a uniform programming interface to different types of network hardware
  • TCP/IP and Internet
    • 1969 ARPAnet
      • Experimental packet-switching network
      • Study robust, reliable, vendor-independent data communication
      • Very successful
    • 1975 ARPAnet became operation network
      • Development continuing
      • TCP/IP was developed
    • 1983 TCP/IP protocols were adopted as Military Standards
      • TCP/IP was implemented in Berkeley Unix.
      • ARPAnet was divided into MILNET and ARPAnet
  • TCP/IP and Internet
    • 1985 NSFNet
      • Connected to the then existing Internet ( MILNET plus ARPAnet)
      • Linked together the five NSF super computer centers
      • Wanted to extend the network to every scientist
    • 1987 new NSFNet backbone
      • Faster
      • Three-tiered topology: backbone, regional networks, and local networks.
  • TCP/IP and Internet
    • 1990 ARPAnet passed out of existence
    • 1995 NSFnet ceased its role as a primary Internet backbone network
    • Today Internet is build by commercial providers.
      • Infrastructure is being created by
        • National network provider, caller tier-one providers
        • Regional network provider
      • Local access and user services is provided by Internet Service Providers (ISPs)
      • Network Access Points (NAPS): major interconnection points
  • TCP/IP and Internet
    • How the internet is managed today
      • Commercial force
      • Several organization
        • Internet Corporation for Assigned Names and Numbers (ICANN)
        • Internet Engineering Task Force (IETE)
        • Internet Society (ISOC)
  • TCP/IP and Internet
    • Network standards and documentation
      • Request for Comments (RFC)
        • Over 4000 has been created
        • FY
        • STD
        • BCP
      • Dispatch central for RFC-related matters
  • Networking Road Map
    • TCP/IP components
      • IP, the Internet Protocol
        • routes data packets from one machine to another
      • ICMP, the Internet Control Message Protocol
        • Provides several kinds of low-level support for IP
          • Error message
          • Routing assistance
          • Debugging help
      • ARP, the Address Resolution Protocol
        • Translates IP addresses to hardware addresses
  • Networking Road Map
      • UDP, the User Datagram Protocol
        • Delivers data to specific applications on the destination machine
        • Provides “unverified”, “best effort” transport for individual messages
      • TCP, the Transmission Control Protocol
        • Delivers data to specific applications on the destination machine
        • Provides reliable, flow controlled, error corrected conversation between processes on two hosts.
  • TCP/IP network model UTP copper, fiber, radia waves ARP, Device Drivers IP ICMP TCP UDP ARP SSH, FTP, WEB DNS, Quake Traeroute Physical layer Link Layer Network Layer Transport Layer Application Layer
  • Packets and encapsulation
    • Data travels on a network in the form of packets
    • Each packet consists of
      • A header – where it came from and where it’s going, protocol info, checksum, etc.
      • A payload - data
    • As a packet travels down the protocol stack
      • encapsulation
        • Each protocol adds its own header information
        • Each protocol’s finished packet becomes the payload part of the packet generated by the next protocol.
    • On a receiving machine, the encapsulation is reversed as the packet travels back up the protocol stack.
  • Packets and Encapsulation
    • Example: A typical network packet
    Ethernet header IP header UDP header Application data Ethernet CRC UDP packet(108 bytes) IP packet(128bytes) Ethernet frame(146 bytes)
  • Addressing
    • Packets addressing
      • Packets must be properly addressed in order to reach their destination
      • Addressing schemes
        • MAC (media access control) addresses for hardware
        • IP addresses for software
        • Hostnames for people
    • Ports
      • 16 bit number
      • Address particular processes or services
      • Well-known ports are defined in /etc/services
      • Unix systems restrict access port under 1024 to root.
  • Addressing
    • Address types
      • Unicast – addresses that refer to a single host (interface)
      • Multicat – addresses that identify a group of hosts
      • Broadcast – addresses that include all hosts on the local network
    • IP addresses
      • Four bytes long
      • Network part and host part
      • Written as decimal numbers, one for each byte separated by periods
      • When 127 is the first byte of an address, it denotes the “loopback network”
        • Lookback address - localhost
  • Addressing
    • IP address classes
      • The traditional class determine which bytes of the address were in the network portion and which were in the host portion
        • A 1-126 N.H.H.H Very early network
        • B 128-191 N.N.H.H large sites (65536)
        • C 192-223 N.N.N.H (256)
        • D 224-239 Multiple addresses
        • E 240- 254 Experimental addresses
  • Addressing
    • Subnetting and netmasks
      • Host portion of an address is “borrowed” to extend the network portion
      • This reassignment is done by using ifconfig command to associate an explicit “subnet mask” with a network interface.
      • Each bit of the netmask that corresponds to the network portion of an IP address is set to 1, host bits are set to 0
        • The division of network part and host part need not fall on a byte boundary
        • Network bits must be contiguous and must appear at the high order end of the addresses
  • Addressing
      • Notation
        • Ipaddress netmask
        • Ipaddress/length of the network part
      • Example
          • Netmask?
          • Network?
          • Broadcast?
        • 100=01100100
          • Netmask?
          • Network?
          • Broadcast?
      • Use ipcalc to get the values.
  • Addressing
    • The IP address crisis
      • Fundamental problems with the original class allocating scheme
        • Run out of B classes
        • Routing table were growing so large
        • IP address were allocated on a first-com, first-served basis with no locality of reference
      • solutions
        • Short term: Classless Inter-Domain Routing (CIDR)
        • IPV6: extend the address to 16 bytes
          • 665,570,793,348,866,943,898,599 addresses
  • Addressing
    • Address allocation
      • Regional IP address registries
        • ARIN North and South America
        • APNIC Asia/Pacific region
        • RIPE Europe and surrounding areas
    • Private addresses
      • Packets bearing private addresses can not get into internet
      • IP address reserved for private use
  • Routing
    • Routing is the process of directing a packet through the maze of networks that stand between its source and its destination.
    • Routing info is stored in a table in the kernel.
      • Examine it use “netstat –r”
      • Configure dynamically
      • Configure statically
      • #route add –net netmask
      • #route add default
  • ARP
    • The address Resolution Protocol discovers the hardware address associated with a particular IP address.
    • APR uses broadcast packets, cannot cross networks
      • “ Does anyone know the hardware address for”?
    • Check the arp cache table with arp command
      • #/usr/sbin/arp –a
    • RARP
      • Reverse translation
      • Query a central server to discover its own address
      • Need configuration
  • Additions of machines to a network
    • Basic steps are
      • Assign a IP address and hostname
      • Set up the new host to configure its network interfaces at boot time
      • Set up a default route and perhaps fancier routing
      • Point to a DNS name server, to allow access to the rest of the Internet.
      • Debugging
        • Always to reboot if changes affect booting
  • Assigning hostnames and IP addresses
    • Mapping hostnames to IP
      • Hosts file
      • NIS or NIS+
      • DNS
      • Or Combination above
    • Hosts file
      • /etc/hosts
        • Each line start with IP, continues with various symbolic names by which that address is known.
        • Entries
          • Localhost, gateway, special hosts, …
        • Replicate same hosts file on machines
    • Configure hostname
      • Command hostname run at the boot time
      • Configuration file
  • Assigning hostnames and IP addresses
    • Configure network interfaces: ifconfig
      • Enable or disable network interface
      • Set IP address
      • Set subnet mask
      • Set other options
      • Run at the boot time (use command with the value from configure files )
      • Format
        • $ifconfig interface address options … up|down
        • Ex:
        • #ifconfig eth0 network up
  • Assigning hostnames and IP addresses
    • Interface name:
      • Identifies the hardware to which the command applies
      • Two or three character device name followed by a number.
      • The loopback interface is named lo0
      • The common interface names are
        • Ie0, le0, ln0, we0, hme0, eri0, lan0, …
    • Display the interfaces
      • $netstat –i
    • Display the setting of interfaces
      • $ifconfig –a
  • Assigning hostnames and IP addresses
    • Configure the network interface
      • The ifconfig commands support many options
        • Specify address
        • Specify netmask, otherwise it uses address class (A,B,C)
        • Specify broadcast
          • Default can be calculated from IP + netmask
          • Some sites set it to avoid certain types of denial of service attacks. Not good.
        • Activate or deactivate the device driver
          • Use keywork up, down.
      • Ifconfig allows you to configure a interface card by hand, but the value is only in kernel.
        • To make it survive the reboot, change the right configuration file
  • Configure static routes
    • Command route defines static routes
      • Static route will stay in the routing table in most case
      • configure the default routing when adding a host to local network
      • Routing is performed at what layer?
        • The packets’ destination IP is compared with the route , if it matches, the packet is forwarded to the “next gateway” IP address associated with that route
        • Routing added when configure the interface - Packets destined for host on a directory connected network
        • Default route is invoked when there is no route that matches the destination address.
  • Configure static routes
      • The format:
        • #route op [type] destination gateway [hop-count]
        • Where
          • Op: add, delete, get, change, flush, monitor
          • Destination: host address, network address, or the keyword “default” (
          • Gateway: a machine to which packets should be forwarded
            • Must be on a directly connected network
            • Forwarding can only be performed one hop at a time
          • Type: -net, -host
      • Check the routing table:
        • #netstat -nr
  • Configure static routes
      • default route
        • #route add default gateway_ip_address
        • Change the configure file
          • Solaris: /etc/defaultrouter
          • Hp-UX: /net/rc.config.d/netconf
          • Redhat: /etc/sysconfig/network
  • Configuring DNS
    • To configure a machine as a DNS client
      • Configure /etc/resolv.conf
        • List DBS domains that should be searched to resolve name that are incomplete
        • Line the IP addresses of the name servers to contact for name lookups
        • Example:
          • [ruihong@dafinn ~]$ more /etc/resolv.conf
          • search
          • nameserver
          • nameserver
  • Configuring DNS
      • Configure the service switch file
        • Which one take effect? /etc/hosts, NIS, DNS?
        • Solaris, Hp-UX, Redhat: /etc/nsswitch.conf
        • Example:
          • hosts: files nis dns
        • Clause: [NOTFOUND=return]
  • Network configuration files by system
    • All
      • /etc/hosts
      • /etc/recolv.conf
    • Solaris
      • /etc/hostname.ifname
      • /etc/nodename
      • /etc/defaultrouter
      • /etc/inet/netmasks
      • /etc/inet/hosts
    • HP-UX
      • /etc/rc.config.d/netconf
    • Red Hat
      • /etc/sysconfig/network
      • Network-scripts/ifcfg-ifname
  • Practice
    • Check
      • IP address/netmask/broadcast
      • route
      • Arp table
      • Hostname
      • DNS
    • Modify
      • Hostname
      • Dns research list
        • Ping wopr
      • Dns servers
      • Remote default route
        • Ping wopr
      • Add the default route back again
    • Reboot
  • DHCP
    • Dynamic Host Configuration Protocol
      • Distribute network and administrative parameters to DHCP client, include
        • IP address and netmasks
        • Gateways
        • DNS name servers
        • Syslog hosts
        • WINs Servers, X font servers, proxy servers, NTP servers
        • TFTP servers ( for loading a boot image)
        • And more…
  • DHCP
    • How DHCP works
      • Client sends “Who am I” DHCPDISCOVER message
        • To broadcast
        • With as its own address
      • Server responds with OFFER messages
      • Client sends back a REQUEST messages
      • Server responds with ACK or NAK
      • Client renew the lease by sending another REQUEST message