Presentation is loading. Please wait.

Presentation is loading. Please wait.

TCP/IP networking1-1 TCP/IP networking  TCP/IP m A networking protocol suite Use several protocols, main ones are tcp and ip. IP stands for Internet Protocol.

Similar presentations


Presentation on theme: "TCP/IP networking1-1 TCP/IP networking  TCP/IP m A networking protocol suite Use several protocols, main ones are tcp and ip. IP stands for Internet Protocol."— Presentation transcript:

1 TCP/IP networking1-1 TCP/IP networking  TCP/IP m A networking protocol suite Use several protocols, main ones are tcp and ip. IP stands for Internet Protocol TCP stands for Transmission Control Protocol. m The native language of the Internet m Supported by most OSs (Unix, MacOS, Windows, Netware, etc) m Defines a uniform programming interface to different types of network hardware

2 TCP/IP networking1-2 TCP/IP and Internet  1969 ARPAnet m Experimental packet-switching network m Study robust, reliable, vendor-independent data communication m Very successful  1975 ARPAnet became operation network m Development continuing m TCP/IP was developed  1983 TCP/IP protocols were adopted as Military Standards m TCP/IP was implemented in Berkeley Unix. m ARPAnet was divided into MILNET and ARPAnet

3 TCP/IP networking1-3 TCP/IP and Internet  1985 NSFNet m Connected to the then existing Internet ( MILNET plus ARPAnet) m Linked together the five NSF super computer centers m Wanted to extend the network to every scientist  1987 new NSFNet backbone m Faster m Three-tiered topology: backbone, regional networks, and local networks.

4 TCP/IP networking1-4 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. m Infrastructure is being created by National network provider, caller tier-one providers Regional network provider m Local access and user services is provided by Internet Service Providers (ISPs) m Network Access Points (NAPS): major interconnection points

5 TCP/IP networking1-5 TCP/IP and Internet  How the internet is managed today m Commercial force m Several organization Internet Corporation for Assigned Names and Numbers (ICANN) –www.icann.org Internet Engineering Task Force (IETE) –www.ietf.org Internet Society (ISOC) –www.isoc.org

6 TCP/IP networking1-6 TCP/IP and Internet  Network standards and documentation m Request for Comments (RFC) Over 4000 has been created FY STD BCP m Dispatch central for RFC-related matters www.rfc-editor.org

7 TCP/IP networking1-7 Networking Road Map  TCP/IP components m IP, the Internet Protocol routes data packets from one machine to another m ICMP, the Internet Control Message Protocol Provides several kinds of low-level support for IP –Error message –Routing assistance –Debugging help m ARP, the Address Resolution Protocol Translates IP addresses to hardware addresses

8 TCP/IP networking1-8 Networking Road Map m UDP, the User Datagram Protocol Delivers data to specific applications on the destination machine Provides “unverified”, “best effort” transport for individual messages m 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.

9 TCP/IP networking1-9 TCP/IP network model UTP copper, fiber, radia waves ARP, Device Drivers IPICMP TCPUDP ARPSSH, FTP, WEBDNS, QuakeTraeroute Physical layer Link Layer Network Layer Transport Layer Application Layer

10 TCP/IP networking1-10 Packets and encapsulation  Data travels on a network in the form of packets  Each packet consists of m A header – where it came from and where it’s going, protocol info, checksum, etc. m A payload - data  As a packet travels down the protocol stack m 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.

11 TCP/IP networking1-11 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)

12 TCP/IP networking1-12 Addressing  Packets addressing m Packets must be properly addressed in order to reach their destination m Addressing schemes MAC (media access control) addresses for hardware IP addresses for software Hostnames for people  Ports m 16 bit number m Address particular processes or services m Well-known ports are defined in /etc/services m Unix systems restrict access port under 1024 to root.

13 TCP/IP networking1-13 Addressing  Address types m Unicast – addresses that refer to a single host (interface) m Multicat – addresses that identify a group of hosts m Broadcast – addresses that include all hosts on the local network  IP addresses m Four bytes long m Network part and host part m Written as decimal numbers, one for each byte separated by periods m When 127 is the first byte of an address, it denotes the “loopback network” Lookback address 127.0.0.1 - localhost

14 TCP/IP networking1-14 Addressing  IP address classes m 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.HVery early network B 128-191N.N.H.Hlarge sites (65536) C 192-223N.N.N.H(256) D 224-239Multiple addresses E 240- 254Experimental addresses

15 TCP/IP networking1-15 Addressing  Subnetting and netmasks m Host portion of an address is “borrowed” to extend the network portion m This reassignment is done by using ifconfig command to associate an explicit “subnet mask” with a network interface. m 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

16 TCP/IP networking1-16 Addressing m Notation Ipaddress netmask Ipaddress/length of the network part –128.138.243.0/26 m Example 128.138.243.100/24 –Netmask? –Network? –Broadcast? 128.138.243.100/26 100=01100100 –Netmask? –Network? –Broadcast? m Use ipcalc to get the values.

17 TCP/IP networking1-17 Addressing  The IP address crisis m 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 m solutions Short term: Classless Inter-Domain Routing (CIDR) IPV6: extend the address to 16 bytes –665,570,793,348,866,943,898,599 addresses

18 TCP/IP networking1-18 Addressing  Address allocation m Regional IP address registries ARINNorth and South America APNICAsia/Pacific region RIPEEurope and surrounding areas  Private addresses m Packets bearing private addresses can not get into internet m IP address reserved for private use 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16

19 TCP/IP networking1-19 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. m Examine it use “netstat –r” m Configure dynamically m Configure statically #route add –net 132.236.220.64 netmask 255.255.255.192 132.236.212.6 #route add default 132.236.227.1

20 TCP/IP networking1-20 ARP  The address Resolution Protocol discovers the hardware address associated with a particular IP address.  APR uses broadcast packets, cannot cross networks m “Does anyone know the hardware address for 128.138.116.4”?  Check the arp cache table with arp command #/usr/sbin/arp –a  RARP m Reverse translation m Query a central server to discover its own address m Need configuration

21 TCP/IP networking1-21 Additions of machines to a network  Basic steps are m Assign a IP address and hostname m Set up the new host to configure its network interfaces at boot time m Set up a default route and perhaps fancier routing m Point to a DNS name server, to allow access to the rest of the Internet. m Debugging Always to reboot if changes affect booting

22 TCP/IP networking1-22 Assigning hostnames and IP addresses  Mapping hostnames to IP m Hosts file m NIS or NIS+ m DNS m Or Combination above  Hosts file m /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 m Command hostname run at the boot time m Configuration file

23 TCP/IP networking1-23 Assigning hostnames and IP addresses  Configure network interfaces: ifconfig m Enable or disable network interface m Set IP address m Set subnet mask m Set other options m Run at the boot time (use command with the value from configure files ) m Format $ifconfig interface address options … up|down Ex: #ifconfig eth0 128.138.240.7 network 255.255.255.0 up

24 TCP/IP networking1-24 Assigning hostnames and IP addresses  Interface name: m Identifies the hardware to which the command applies m Two or three character device name followed by a number. m The loopback interface is named lo0 m The common interface names are Ie0, le0, ln0, we0, hme0, eri0, lan0, …  Display the interfaces m $netstat –i  Display the setting of interfaces m $ifconfig –a

25 TCP/IP networking1-25 Assigning hostnames and IP addresses  Configure the network interface m 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. m 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

26 TCP/IP networking1-26 Configure static routes  Command route defines static routes m Static route will stay in the routing table in most case m configure the default routing when adding a host to local network m 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.

27 TCP/IP networking1-27 Configure static routes m 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” ( 0.0.0.0) –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 m Check the routing table: #netstat -nr

28 TCP/IP networking1-28 Configure static routes m 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

29 TCP/IP networking1-29 Configuring DNS  To configure a machine as a DNS client m 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 cs.mtu.edu csl.mtu.edu mtu.edu nameserver 141.219.152.253 nameserver 141.219.152.254

30 TCP/IP networking1-30 Configuring DNS m 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]

31 TCP/IP networking1-31 Network configuration files by system  All m /etc/hosts m /etc/recolv.conf  Solaris m /etc/hostname.ifname m /etc/nodename m /etc/defaultrouter m /etc/inet/netmasks m /etc/inet/hosts  HP-UX m /etc/rc.config.d/netconf  Red Hat m /etc/sysconfig/network m Network-scripts/ifcfg-ifname

32 TCP/IP networking1-32 Practice  Check m IP address/netmask/broadcast m route m Arp table m Hostname m DNS  Modify m Hostname m Dns research list Ping wopr m Dns servers m Remote default route Ping wopr m Add the default route back again  Reboot

33 TCP/IP networking1-33 DHCP  Dynamic Host Configuration Protocol m 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…

34 TCP/IP networking1-34 DHCP  How DHCP works m Client sends “Who am I” DHCPDISCOVER message To broadcast 255.255.255.255 With 0.0.0.0 as its own address m Server responds with OFFER messages m Client sends back a REQUEST messages m Server responds with ACK or NAK m Client renew the lease by sending another REQUEST message


Download ppt "TCP/IP networking1-1 TCP/IP networking  TCP/IP m A networking protocol suite Use several protocols, main ones are tcp and ip. IP stands for Internet Protocol."

Similar presentations


Ads by Google