Presentation is loading. Please wait.

Presentation is loading. Please wait.

Agenda Internet Address Pair Internet Address Pair IP Address IP Address Port Address Port Address Network Address Translation (NAT) Network Address Translation.

Similar presentations


Presentation on theme: "Agenda Internet Address Pair Internet Address Pair IP Address IP Address Port Address Port Address Network Address Translation (NAT) Network Address Translation."— Presentation transcript:

1 Agenda Internet Address Pair Internet Address Pair IP Address IP Address Port Address Port Address Network Address Translation (NAT) Network Address Translation (NAT) Domain Name Domain Name

2 Internet Address Part I Two Parts

3 2=1 IP Address IP Address 0.0.0.0 0.0.0.0 255.255.255.255 255.255.255.255 Port Port 0-64 k 0-64 k The full Internet Address pair The full Internet Address pair : : 10.10.125.5:80 10.10.125.5:80 Type in your web browser (demo) Type in your web browser (demo)

4 IP Address P.O.er There

5 IP Address Size & Form IPv4 – Current Standard - Legacy IPv4 – Current Standard - Legacy 32 bits total 32 bits total 8 bit sections (base10 = 0-255) 8 bit sections (base10 = 0-255) 255.255.255.255 255.255.255.255 IPv6 – Emerging Standard IPv6 – Emerging Standard 128 bits total (4 x IPv4) 128 bits total (4 x IPv4) 16 bit sections (hex = 0-FFFF) 16 bit sections (hex = 0-FFFF) FFFF:0000:FFFF:0000:FFFF:0000:FFFF:0000 FFFF:0000:FFFF:0000:FFFF:0000:FFFF:0000

6 IP Address Formatting Convert IP address to network format Convert IP address to network format Inet_addr (char * stringFormat) Inet_addr (char * stringFormat) Returns: struct in_addr Returns: struct in_addr Fails if not an IP address Fails if not an IP address Some confusing number completion intelligence Some confusing number completion intelligence “125.126.4”  125.126.0.4 “125.126.4”  125.126.0.4 “125.4”  125.0.0.4 “125.4”  125.0.0.4 “125.126.12844”  125.126.128.44 “125.126.12844”  125.126.128.44 Inet_ntoa (struct in_addr) Inet_ntoa (struct in_addr) Returns an ASCII string Returns an ASCII string htons (short HostOrderShort) htons (short HostOrderShort) Returns the short in network byte order (i.e., swapped for Windows) Returns the short in network byte order (i.e., swapped for Windows) Example Example SOCKADDR_IN addr; addr.sin_family = AF_INET; addr.sin_addr.s_addr = inet_addr(“159.151.11.3”); addr.sin_port = htons(80);

7 IP Address Positional Meaning 35.1.9.7 35.1.9.7 Network Prefix Network Prefix 35 35 Subnet Subnet 1 9 Host Host 7

8 IP Addressing Special Addresses 255.255.255.255 255.255.255.255 INADDR_NONE == INADDR_BROADCAST INADDR_NONE == INADDR_BROADCAST Must setup a DATAGRAM for limited broadcast Must setup a DATAGRAM for limited broadcast 0 INADDR_ANY == ADDR_ANY INADDR_ANY == ADDR_ANY sin_addr.s_addr set to this before bind() so it assigns default. sin_addr.s_addr set to this before bind() so it assigns default. 127.0.0.1 127.0.0.1 INADDR_LOOPBACK INADDR_LOOPBACK Send to self Send to self *.*.*.{240-255} *.*.*.{240-255} Directed Broadcast to a specific subnet Directed Broadcast to a specific subnet *.*.*.{224-239} *.*.*.{224-239} Multicast group IP Multicast group IP

9 IP Addressing Types of addresses Unicast Unicast Address assigned to an individual Address assigned to an individual Static Static You assign your own (uncommon these days) You assign your own (uncommon these days) DHCP (Dynamic Host Configuration Protocol) DHCP (Dynamic Host Configuration Protocol) Server assigned address Server assigned address APIPA (Automatic Private IP Addressing) APIPA (Automatic Private IP Addressing) Used by routers servicing a single DHCP assigned address Used by routers servicing a single DHCP assigned address Default if DHCP not available Default if DHCP not available This is NOT your MAC address on your NIC This is NOT your MAC address on your NIC Multicast Multicast Address to a list of addresses Address to a list of addresses Temporary groups Temporary groups Broadcast Broadcast Limited = everyone on your local net Limited = everyone on your local net Directed = send to a subnet Directed = send to a subnet

10 Port Not your ordinary desert wine.

11 Ports The other half of the address 16 bit number = 0 - 65,536 16 bit number = 0 - 65,536 Receiving Port Receiving Port Must specify a specific port to listen on Must specify a specific port to listen on Sending Port Sending Port Send on any available port (sockets decides) Send on any available port (sockets decides) Can specify send port, but may conflict Can specify send port, but may conflict

12 Ports Known & Not So Known Well Known Ports Well Known Ports 0-1024 0-1024 Internet Assigned Number Authority (IANA) – The Registrar Internet Assigned Number Authority (IANA) – The Registrar Reserved for standard services (FTP, WWW, SMTP, Telnet, …) Reserved for standard services (FTP, WWW, SMTP, Telnet, …) Can use for anything (not recommended) Can use for anything (not recommended) Often filtered by network hardware Often filtered by network hardware IP address ignored and packet redirected to specific protocol server IP address ignored and packet redirected to specific protocol server Examples Examples HTTP = Port 80 (web server) HTTP = Port 80 (web server) FTP = Port ? (check answer at www.iana.net) FTP = Port ? (check answer at www.iana.net)www.iana.net Registered Port Numbers Registered Port Numbers 1024-65,536 1024-65,536 Not controlled by IANA Not controlled by IANA Some common services use 1024-10,000 Some common services use 1024-10,000 Be safe, stay high Be safe, stay high Hippie Slogan or Good Advice? Hippie Slogan or Good Advice? 10k-64k 10k-64k

13 Firewalls Keep Out!

14 Types of Firewalls Packet Filter Packet Filter Proxies Proxies Circuit Gateways Circuit Gateways

15 NAT A baby Mosquito?

16 Network Address Translation What is it for? What is it for? Multiple NIC’s share the same IP Address Multiple NIC’s share the same IP Address Who does this? Who does this? Routers at work/home sharing one IP Address Routers at work/home sharing one IP Address How does it do it? How does it do it? Each NIC assigned an APIPA address Each NIC assigned an APIPA address APIPA + Port α converted to Shared IP + Port β APIPA + Port α converted to Shared IP + Port β Router maintains the translation table and redirects incoming traffic accordingly. Router maintains the translation table and redirects incoming traffic accordingly.

17 NAT in action LAN AddressWAN Address 192.168.1.1:20024.15.1.118:200 192.168.1.1:20124.15.1.118:201 192.168.1.2:19924.15.1.118:199 192.168.1.2:20024.15.1.118:4000* Figure 1 Network Address Translation at work.

18 NAT Traversal Port Forwarding Port Forwarding Port always assigned to 1 computer Port always assigned to 1 computer Port Triggering Port Triggering Starting application temporarily forwards port Starting application temporarily forwards port DMZ DMZ All traffic also goes to specific computer All traffic also goes to specific computer Determining WAN IP Determining WAN IP From computer on the other side of router From computer on the other side of router IP Helper API, router config table IP Helper API, router config table

19 Domain Name www.yahoo.com chuck.toonedin.com

20 Domain Name Resolution Facilities Local Host Table (i.e. a cache) Local Host Table (i.e. a cache) \SYSTEM32\DRIVERS\ETC\HOSTS (demo) \SYSTEM32\DRIVERS\ETC\HOSTS (demo) \SYSTEM32\DRIVERS\ETC\HOSTS Fast, customizable Fast, customizable Doesn’t scale, gets out of synch with changes Doesn’t scale, gets out of synch with changes Domain Name Service (DNS) Server Domain Name Service (DNS) Server Off site server Off site server Faster updates, hands off, scales Faster updates, hands off, scales Slower, no control on updates, not always available Slower, no control on updates, not always available Propagation takes time (hrs – weeks) Propagation takes time (hrs – weeks) Case Study Case Study Use DNS if available Use DNS if available Store last used and defaults when not Store last used and defaults when not Ping Demo Ping Demo Plethora of other custom services Plethora of other custom services Network Information Service (unix) Network Information Service (unix) NetBIOS over TCP/IP NetBIOS over TCP/IP Windows NLA: Network Location Awareness (mobile computing) Windows NLA: Network Location Awareness (mobile computing)


Download ppt "Agenda Internet Address Pair Internet Address Pair IP Address IP Address Port Address Port Address Network Address Translation (NAT) Network Address Translation."

Similar presentations


Ads by Google