480 likes | 644 Views
Networking - Review. TCP/IP. The protocol suite of TCP/IP is the world’s most widely implemented network protocol. The combination of TCP/IP with the Web browser creates a new type of client/server network operating system. TCP/IP (cont.). TCP/IP networks are heterogeneous.
E N D
TCP/IP • The protocol suite of TCP/IP is the world’s most widely implemented network protocol. • The combination of TCP/IP with the Web browser creates a new type of client/server network operating system.
TCP/IP (cont.) • TCP/IP networks are heterogeneous. • It is popular because: • Protocol suite part of the Berkeley Unix operating system • College students worked with it and then took it to corporate America • In 1983, all government proposals required TCP/IP • The WWW graphical user interface • TCP/IP works on any operating platform. • TCP/IP has easy remote access capabilities. • TCP/IP is FREE
Application Application Presentation Presentation Session Session Transport Transport Network Network Network Datalink Datalink Datalink Physical Physical Physical Physical Medium ISO OSI Reference Model • Seven layers • Lower three layers are peer-to-peer • Next four layers are end-to-end
The TCP/IP Stack • TCP/IP pre-dates the OSI model • Exhibits many of the same characteristics: • layering • independence from underlying layers • TCP/IP can fitted into the OSI model • Only provides 4 distinct layers of its own
The TCP/IP Stack (cont.) • It was designed by us DOD • Has continued to be developed • It is NOT directly OSI compliant • It has become almost ubiquitous for networking • It is very flexible and can be used for transmission over lots of media types
The TCP/IP Stack (cont.) Applications Applications Transport TCP/UDP Internetwork IP ICMP ARP/RARP Network Interface and Hardware Network Interface and Hardware
The TCP/IP Stack (cont.) • Application Layer • An application is a user process cooperating with another process on the same or a different host. • Telnet, FTP, SMTP, and Gopher. • The interface between the application and transport layers is defined by port numbers and sockets, • Transport Layer • The transport layer provides the reliable end-to-end data transfer. • TCP and UDP are Used
The TCP/IP Stack (cont.) • Internet work Layer • Internet layer or the Network layer, • provides the “virtual network” image of an internet • Internet Protocol (IP) is the most important protocol. • Connectionless protocol that doesn't assume reliability from the lower layers. • IP does not provide reliability, flow control or error recovery. • Responsible for the correct Routing of Information • Network Interface Layer • Link layer or the data-link layer • interface to the actual network hardware. TCP/IP can use almost any network interface available, which illustrates the flexibility of the IP layer. • IEEE 802.2, X.25 (which is reliable in itself), ATM, FDDI and even SNA.
The TCP/IP Stack (cont.) Applications FTP, SMTP,Telnet, Gopher, … Transport TCP UDP Internetwork IP ICMP A R P R A R P Network Interface and Hardware Ethernet, Token-ring, FDDI, X.25, Wireless Async, ATM, SNA, …
TCP socket identified by 4-tuple: • source IP address • source port number • dest IP address • dest port number • recv host uses all four values to direct segment to appropriate socket
IP Addressing(IPv4) • Reasons why we need to look at IP addressing and subnetting: • Need to better understand how the internet works • Home and small business networking is booming, IP addressing is no longer the domain of ones ISP or network administrators • IP addressing can be explained with simple binary arithmetic
IP Addressing(IPv4) (cont.) • IPv4 allows for 32bits to be used in determining the address of a system • 232 =4,294,967,296 addresses, • IP addresses are normally written as a sequence of four decimal numbers separated by periods. This notation is known as Dotted Quad Notation : 192.228.17.62. • The IP address may also be represented in HEX or in binary • Address consists of two portions • Network Address • Host Address • Hosts that share a network number can send local broadcasts to one another and communicate without a router. • Hosts with differing network numbers can communicate only via an IP router/ Gateway
IP Addressing(IPv4) (cont.) • A netmask is used to separate the network portion of the IP address from the host ID part • The natural masks are the most commonly used net masks • Class A • First Octet determines the Network • 224 - 2 = 16,777,214 hosts • Class B • First Two Octets determines Network • 216 - 2 = 65,534 • Class C • First Three Octets determine Network • 28 - 2 = 254 host addresses
IP Addressing(IPv4) (cont.) • Class A • 0 In the first bit • 0 -> 127 • Class B • 1 in the first bit and a 0 in the second bit of the first octet. • 128 -> 191 (10000000 binary to 10111111 binary). • The second octet is also part of the network number. • 16,382 Class B Networks • Class C • 1s in the first two bits and a 0 in the third bit of the first octet • second and third octets used for the network number. • 192 -> 223 (11000000 binary to 11011111 binary). • There are 2,097,150 Class C addresses. • Class D & E • Network numbers with the first digit higher than 223 are reserved for special purpose
IP Addressing(IPv4) (cont.) Class A 0 7 bits of network address 24 bits of host address First byte Last three bytes Class B 10 14 bits of network address 16 bits of host address First two bytes Last two bytes Class C 110 21 bits of network address 8 bits of host address First three bytes Last byte
Subnets • Subnetting is the process of allocating bits from the host portion as a network portion • A means of extending a larger natural netmask • Provides smaller manageable network chunks • Makes use of using some of the most significant (leftmost) host bits of the IP address as a means of extending the network portion • How many are used depends on the network mask or netmask
Subnets (cont.) • A subnet mask is a bitmask that encodes the prefix length in a form similar to an IP address - 32 bits, starting with a number of 1 bits equal to the prefix length, ending with 0 bits, and encoded in four-part dotted-decimal format • A subnet mask encodes the same information as a prefix length, but predates the advent of CIDR.
Classless Inter-Domain Routing(CIDR) • CIDR is a bitwise, prefix-based standard for the interpretation of IP addresses • was introduced in 1993 • increased flexibility when dividing ranges of IP addresses into separate networks • More efficient use of IPv4 addresses • Greater use of hierarchy in address assignments (prefix aggregation), lowering the overhead of the Internet-wide routing
Classless Inter-Domain Routing(CIDR) (cont.) • Easier routing - blocks of addresses can be grouped together into single routing table entries (CIDR blocks).
CIDR Blocks • share an initial sequence of bits in the binary representation of their IP addresses • understanding CIDR requires that IP address be visualized in binary • IPv4 CIDR blocks are identified using a syntax similar to that of IPv4 addresses: • a four-part dotted-decimal address • followed by a slash • then a number from 0 to 32 • A.B.C.D/N
CIDR Blocks (cont.) • The dotted decimal portion is interpreted, like an IPv4 address, as a 32-bit binary number that has been broken into four 8-bit bytes • The number following the slash is the prefix length, the number of shared initial bits, counting from the left-hand side of the address • An IP address is part of a CIDR block, and is said to match the CIDR prefix if the initial N bits of the address and the CIDR prefix are the same
CIDR Blocks (cont.) • the length of an IPv4 address is fixed at 32 bits • an N-bit CIDR prefix leaves 32 − N bits unmatched • there are 2(32 − N) possible combinations of these bits, that is 2(32 − N) IPv4 addresses match a given N-bit CIDR prefix • shorter CIDR prefixes match more addresses • longer CIDR prefixes match fewer • an address can match multiple CIDR prefixes of different lengths
CIDR Blocks (cont.) • The Internet Assigned Numbers Authority (IANA) issues to Regional Internet Registries (RIRs) large, short-prefix CIDR blocks • Large Internet service providers (ISPs) typically obtain CIDR blocks from a RIR, then subdivide them into smaller CIDR blocks for their subscribers, sized according to the size of the subscriber's network • Networks served by a single ISP obtain IP address space directly from their ISP • Networks served by multiple ISPs will often obtain independent CIDR blocks directly from the appropriate RIR
CIDR Mask • CIDR uses variable length subnet masks (VLSM) to allocate IP addresses to subnets according to individual need, rather than some general network-wide rule • The network/host division can occur at any bit boundary in the address • The process can be recursive, with a portion of the address space being further divided into even smaller portions, through the use of masks which cover more bits • CIDR/VLSM network addresses are now used throughout the public Internet • Average desktop LAN users generally do not see them in practice, as their LAN is usually numbered using special private network addresses
CIDR – Prefix Agregation • Routing prefix aggregation (also known as "supernetting") is another benefit of CIDR • For example: • Sixteen contiguous /24 networks could now be aggregated together, and advertised to the outside world as a single /20 route (if the first 20 bits of their network addresses match). • Two aligned contiguous /20s could then be aggregated to a /19, and so forth. • This allows a significant reduction in the number of routes that have to be advertised over the Internet • It prevents 'routing table explosions' from overwhelming routers, and stopping the Internet from expanding further.
Computers and Networks • Computers on the same network can communicate directly • Computers on different networks communicate via a gateway • Collision domain is the physical network • IP network may differ from the physical collision domain.
Broadcast Addressing • Address: 10010010.11100111.01111 011.00001111 • Netmask: 11111111.11111111.11111 000.00000000 • Network: 10010010.11100111.01111 000.00000000 • Broadcast: 10010010.11100111.01111 111.11111111 • Broadcast address: • the address used to communicate with all hosts on the local network. • Originally the lowest bit-value was used. This is now deprecated • Defined as the highest value that is on a network • Calculate by replacing all the host address portion bits with 1s
Masking Hosts • 0 1x 256 -> 254 hosts 0.75% wastage • 128 2x 128 -> 2x 126 hosts 1.5% wasted • 192 4x 64 -> 4x 62 hosts 3.12% wasted • 224 8x 32 -> 8x 30 hosts 6.25% wasted • 240 16x 16 -> 16x 14 hosts 12.5% wasted • 248 32 x 8 -> 32x 6 hosts 25% wasted • 252 64 x 4 -> 64x 2 hosts 50% wasted • 254 128 x 2 -> 128x 0 host 100% wasted • 255 All
IP Packet - Structure • IP Header consists of many fields • The first field is the VERS, or version, field. This defines the version of IP implemented originating host. • Version 4 and 6 are in use • Version 5 is known as the Streams 2 protocol. • IP header information taken from RFC 1700. • 0 Reserved • 1–3 Unassigned • 4 IP Internet Protocol RFC791 • 5 ST ST Datagram Mode • 6 IPv6 RFC 1883 • 7 TP/IX TP/IX: The Next Internet • 8 PIP The P Internet Protocol • 9 TUBA TUBA • 10–14 Unassigned • 15 Reserved
IP Payloads • 1 ICMP # internet control message protocol • 4 IP-ENCAP # IP encapsulated in IP (IPIP) • 6 TCP # transmission control protocol • 17 UDP # user datagram protocol • 27 RDP # "reliable datagram" protocol • 41 IPV6 # ipv6 • 46 RSVP # Resource ReSerVation Protocol • 47 GRE # Generic Routing Encapsulation • 50 ESP # encapsulating security payload • 51 AH # authentication header
TCP • TCP provides application programs access to the network, using a reliable connection–oriented transport–layer service. • Responsible for establishing sessions between user processes on the internet • Ensures reliable communications between two or more processes. • TCP provides functions to: • 1. Listen for incoming session establishment requests • 2. Request a session to another network station • 3. Send and receive data reliably using sequence numbers and acknowledgments • 4. Gracefully close a session
TCP – Flags • URG - Indicates that the URGENT pointer is valid • ACK - Acknowledgement number is valid • PSH - Application should be passed data as soon as possible • RST - Resets the connection • SYN - Synchronise sequence numbers (connection setup) • FIN - Sender is finished –it initiates a connection teardown
UDP • The User Datagram Protocol (UDP) provides application programs access to the network using an unreliable connectionless transport–layer service. • Allows the transfer of data between source and destination stations without having to establish a session before data is transferred. • Does not use the end–to–end error checking and correction that TCP uses. • UDP provides low overhead, transport–layer functionality • Used for those applications that do not require the robustness of the TCP protocol
ICMP • Internet Control Message Protocol • When a router or a destination host must inform the source host about errors in datagram processing, it uses the Internet Control Message Protocol (ICMP). • ICMP uses IP as if ICMP were a higher level protocol • However, ICMP is an integral part of IPand must be implemented by every IP module. • ICMP is used to report some errors, not to make IP reliable. • ICMP can report errors on any IP datagram with the exception of ICMP • ICMP messages are never sent in response to ICMP error messages. They can be sent in response to ICMP query messages
ICMP - Messages • Type – Specifies the type of the message: • Code – Contains the error code for the datagram reported on by this ICMP message. The interpretation is dependent upon the message type. • Checksum – Contains the 16-bit one's complement of the one's complement sum of the ICMP message starting with the ICMP Type field. • – This algorithm is the same as that used by IP for the IP header. • Data – Contains information for this ICMP message. Typically it will contain a part of the original IP message for which this ICMP message was generated. • Length – This can be determined from the length of the IP datagram that contains the message less the IP header
ICMP Types • 0 Echo reply • 3 Destination unreachable • 4 Source quench • 5 Redirect • 8 Echo • 11 Time exceeded • 13 Time Stamp request • 14 Time Stamp reply • 30 Traceroute