* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download UNIT name: IP protocol
Distributed firewall wikipedia , lookup
Piggybacking (Internet access) wikipedia , lookup
IEEE 802.1aq wikipedia , lookup
Network tap wikipedia , lookup
Computer network wikipedia , lookup
Wake-on-LAN wikipedia , lookup
Recursive InterNetwork Architecture (RINA) wikipedia , lookup
Airborne Networking wikipedia , lookup
Zero-configuration networking wikipedia , lookup
UNIT name: IP routing o What are the PRIOR knowledge for unit – concepts what must be covered before bit/bait AND ja OR operations in 2-nd system IP addresses, masks o AIM of the unit Understands how IP packets are handled in routers of IP network and is able to correctly configure router parameters. o Theory (HTML text - possible with links to outside material and simple flash) 1. Routing Look again to ISO/OSI simulation (in unit “ISO/OSI model”, especially Network Layer in that. Look also another simple picture of routing: http://www.windowsnetworking.com/articles_tutorials/route.html Ordinarily routing is hierarchical – there is only one track (road) from one node to another. In some cases there is different routes available, called multiple routing networks. Hierarchical routing, Source: http://www.uga.edu/~ucns/lans/tcpipsem/ Multiple routing, Source - http://www.uga.edu/~ucns/lans/tcpipsem/ Multiple routing is used in backbone systems. Information between routers is exchanged to clarify best routs in the situation (timeframe). Source - http://www.ces.net/doc/2004/research/nren.html INTERESTING SERVICE: Geological identification of IP addresses based of routing information in the internet: http://www.ipaddresslocation.org/ and http://www.xkcd.com/c195.html 2. Routing table In the routing table of the IP network node there is written all the information about IP networks, the node knows. To remember - IP addresses (as the network protocol of TCP/IP family) are divided into two logical parts – network address and node address – by address mask (look more in IP unit). In the routing table we can see it like follows as an example: Network Destination Netmask 0.0.0.0 0.0.0.0 127.0.0.0 255.0.0.0 172.10.0.0 255.255.255.0 172.10.0.187 255.255.255.255 Gateway 172.10.0.1 127.0.0.1 172.10.0.187 127.0.0.1 Interface 172.10.0.187 127.0.0.1 172.10.0.187 127.0.0.1 Metric 30 1 30 30 There is defined networks by “Destination” and “Netmask” connected to “Interface” by means of Data Link Layer (or Physical) segments which are available for the node (as LAN, WLAN etc), which has configured IP address. Then “Gateway” is an address of node, which knows more or which actually transports packets from one network segment to other. The node defined as gateway for other IP nodes is called router. Routers are nodes, which are parts of different IP network segments. These network segments can be physically in one or different Datalink Layer segment as they are not interrelated in theory. So, router can define two different IP networks in the same physical network segment – then nodes (computers etc) in the same physical network segment, but different IP network segment, are communicating only thorough router although they are in the same physical network segment. Some network equipments are connecting different physical segments (ADSL modems, WLAN AP-s, different bridges etc), but IP network is actually the same over these different networks. Every router, on the track between source and destination node, is making a transport “hop” and of course takes some additional time to carry on giving additional latency for packet delivery. Of course bridges between different physical segments are giving additional latency too, but they are not visible as hops in the track from source to destination. TASK: Try to figure out with MS Windows command “tracert”, how many hops there is from your computer to www.google.com. If node (with source IP address) is willing to send IP packet to other node (destination IP address), there will be used routing table of the node to calculate, where to send packet by means of gateway. If the gateway is in the list of interfaces of the node, packet will be sent straightly to the destination IP address thorough interface (found in routing table). If the gateway is other IP node, the packet will be sent to the router (gateway address). To find the right routing table row for each IP packet, destination address is compared with each network in routing table starting with smallest (network mask is “bigger”). If the network address matches, right row is found. Broadest network in every routing table is called “Default gateway” as there are “all other networks”. In the example of routing table there is smallest “network segment” with the mask 255.255.255.255. This is actually local interface address of the node itself, not real network. Second smallest network is 172.10.0.0/24 which is actually LAN connection in the one building where the node is situated. Third network 127.0.0.0/8 is special address area for local addressing inside the node, called “Loopback network”. And last, biggest network, is the default route (gateway) to other networks. Actually, sometimes one node can have many different IP addresses defined for one physical network interface (Network Interface Card – NIC). Look another example at Microsoft TechNet, article “The IP routing table”: http://technet2.microsoft.com/WindowsServer/en/library/63158f32-9fcd-42ea-ba2f8008bb7bb5241033.mspx?mfr=true 3. NAT Network Address Translation (NAT) is used inside organizations for there are not enough addresses for all nodes in the world, and also it gives some security advances. As defined in RFC 1631 (http://tools.ietf.org/html/rfc1631) NAT gives possibility to use same address space (private addresses) in different organizations at the same time. NAT is additional functionality of a router. NAT translates private addresses to another (public) address and remembers this translation for feedback packets (connection tracking data). Because of NAT can not provide connectivity from “outside world” to “inside”, it is giving natural firewall functionality by that way. All the nodes behind NAT are visible to outside world as one node. There is simulation of NAT (in estonian): http://iva.tpt.edu.ee/opiobjektid/nat/ Because of translation only in IP packet header NAT can be problem for some applications, when IP address is used in higher level too (FTP active connections etc.). Read more: http://en.wikipedia.org/wiki/Network_address_translation 4. Calculations Every node and router needs to calculate for every IP address in every IP packet it handles, in which IP network it belongs eg. where to send it. Let’s look over again masks to remember: Net bits Subnet mask total-addresses /20 255.255.240.0 4096 /21 255.255.248.0 2048 /22 255.255.252.0 1024 /23 255.255.254.0 512 /24 255.255.255.0 256 /25 255.255.255.128 128 /26 255.255.255.192 64 /27 255.255.255.224 32 /28 255.255.255.240 16 /29 255.255.255.248 8 /30 255.255.255.252 4 (Source: http://xtronics.com/reference/ip-subnetmasks.htm) If node needs to calculate network address from IP address, it takes a logical operation AND between IP address and Mask as follows: ip = 10000000 11000000 11111110 01100100 (128.192.254.100) netmask = 11111111 11111111 00000000 00000000 (255.255.0.0) AND operation ----------------------------------network = 10000000 11000000 00000000 00000000 (128.192.0.0) If network administrator needs to calculate network addresses or choose correct address values for nodes there is need to modify numbers from decimal system to binary and vice versa. There are different possibilities for that. For example to modify 10-system number to binary, you can use division by 2 like follows: Task: There is IP defined in the documentation: IP=213.168.16.220/28 Administrator needs to calculate right network address for routing information. Solution: Mask /28 means, that there are 28 ones and 4 zeros in the end. It means last octet is 11110000 and other octets are 1 in the binary view: MASK=11111111.11111111.11111111.11110000 (2) So we need to calculate actually only last octet for IP address because of first three octets are representing fully network address. 220 (10) =? 220/2, 0 110/2, 0 55/2, 1 27/2, 1 13/2, 1 6/2, 0 3/2, 1 1/2, 1 220 (10) = 11011100 (2) Then we do AND operation, as follows: 11011100 11110000 -------11010000 (2) IP (2) MASK AND (2) NETWORK Now we modify this back to decimal system using exponents of two for each position starting 0 to 7. 2 exponent 0 we multiply with last position (right side), 2 exponent 1 with second position etc until 2 exponent 7 with last (eight from right side, first one from left) position. 2exp0*0+2exp1*0+2exp2*0+2exp3*0+2exp4*1+2exp5*0+2exp6*1+2exp7*1 It means, in these positions, where is 0, we actually do not need to calculate exponent: 2exp4*1+2exp6*1+2exp7*1 All the IT administrators have exponents of 2 in the head :) – so we quickly summarize it: 16+64+128=208 (10) Answer: And there is the solution for network address for IP=213.168.16.220/28 NETWORK=213.168.16.208/28 or NETWORK=213.168.16.208/255.255.255.240 Look for the simulation too as next example: We use attachment here hopefully! If not, then delete it. If there is need to calculate broadcast address, it is the same like networks address in binary view, only the positions, where mask has zeros, in the broadcast address there are ones: 11011100 11110000 -------11010000 11011111 (2) (2) AND (2) (2) IP MASK operation NETWORK BROADCAST Of course administrators can use special IP subnet calculators or calc.exe :) - http://www.google.com/search?q=ip+subnet+calculator - www.wildpackets.com (downloadable program) 5. Additional material (Maybe not to include?): - Fragmentation? - http://lin2.tlu.ee/~matsak/telecom/3.html and http://en.wikipedia.org/wiki/IPv4#Fragmentation_and_reassembly ) - Configuring router boxes (example pictures?) o Linux routers (example pictures) o “Routing” with Layer 2 (with ARP) o “Routing” with upper layers - Proxy - Detecting packet loss and latency (explain router buffers besides of datalink layer latency) o ping o tracert (traceroute) - Direct routing schemes (read abut: http://en.wikipedia.org/wiki/Routing): o unicast o multicast (IGMP) o broadcast Links: - http://cable-dsl.home.att.net/ o Attachments (Videos, Simulations etc – describe!!!) The IP address (193.40.136.67) and Mask (255.255.255.240) is in the Computer X. Another IP (192.40.136.57) and Mask (255.255.255.240) is in the Computer Y. Question mark in the middle with sequentially showing : - are the computers in the same network? - How can we (computers themselves) find it out? Solution: lets calculate network addresses for both computers and compare, are they equal (are they in the same IP network)? 1. Computer X Mask is zoomed and modified to 2-system We start with modifying last part - it means, if mask is 255.255.255.240, then 240: 240 (10) =? 240/2, 0 120/2, 0 60/2, 0 30/2, 0 15/2, 1 7/2, 1 3/2, 1 1/2, 1 240 (10) = 11110000 (2) Additionally explained, that 255 (10) means 11111111 (2). 2. Next same with IP address of Computer X 67 (10) =? 67/2, 1 33/2, 1 16/2, 0 08/2, 0 04/2, 0 02/2, 0 01/2, 1 67 (10) = 01000011 (2) Same with: 193 (10) =? 40 (10) =? 136 (10) =? 3. Next Computer Address and Mask are put together with AND operation, like: 193.040.136.067 = 11000001.00101000.10001000.01000011 255.255.255.240 = 11111111.11111111.11111111.11110000 193.040.136.064 = 11000001.00101000.10001000.01000000 (net) And there it is – network address for Computer X. There can be marked with BOLD (or little flash) the network part of the IP address as it is the same with Network address (area of 1-s in the mask). 4. There can be modifying from binary to 10-systema again in the way of exponents: 11000001 (2) = 2exp0+2exp6+2exp7 = 1+64+128 = 193 (10) 4. Next same with IP address of Computer Y 57 (10) =? 57/2, 1 28/2, 0 14/2, 0 07/2, 1 03/2, 1 01/2, 1 57 (10) = 00111001 (2) 5. Next Computer Address and Mask are put together with AND operation, like: 193.040.136.057 = 11000001.00101000.10001000.00111001 255.255.255.240 = 11111111.11111111.11111111.11110000 193.040.136.048 = 11000001.00101000.10001000.00110000 (net) And there it is – network address for Computer Y. As the answer there you can see, that network address for X and Y are different, and they can not communicate with each other. o Quiz (best is 1…x right answers of 3…6 choices, may be different quizzes – for self-learning and grading) 1. IP address is usually presented like: a. x.y.z b. xx-xx-xx-xx-xx-xx c. x.y.z.w (x) d. domain.com 2. IP address and Mask are defining: a. network address (x) b. gateway address c. broadcast address (x) d. unicast address e. node address (x) f. source address 3. Please calculate Network, Broadcast and Gateway address for node 219.213.168.226/30 (can use MS windows calc or else) a. right answer is: i. network=219.213.168.224 ii. broadcast=219.213.168.227 iii. gateway=219.213.168.225 4. Routing table is giving information about: a. IP networks nearby node (x) b. All networks in the internet c. All node interfaces available d. Node interfaces using IP (x) e. Network speed 5. Which MS Windows command you can use, to see IP network hops to destination host: a. ping b. tracert (x) c. ipconfig d. cmd 6. Routers are working in ISO/OSI a. Layer 1 b. Layer 2 c. Layer 3 (x) d. Layer 4 e. Layer 5 7. How many different IP addresses can be defined to a network interface a. 1 b. 2 c. 5 d. no limits (x) 8. How many nodes can be defined in IP network, with mask 255.255.255.252 a. 2 (x) b. 4 c. 8 d. 16 9. Broadcast address is a. first address in IP network address area b. last address in IP network address area (x) c. special address outside IP network definition 10. What is the gateway for IP network node 219.201.46.125, if IP-s are between 219.201.46.124-219.201.46.127. a. 219.201.46.124 b. 219.201.46.125 c. 219.201.46.126 (x) d. 219.201.46.127