Networking For Application Developers by Roy Kim

6,176 views

Published on

Networking for Application Developers

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
6,176
On SlideShare
0
From Embeds
0
Number of Embeds
4,392
Actions
Shares
0
Downloads
35
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • http://technet.microsoft.com/en-us/library/hh182191.aspx IT Networking for Application Developers: Knowing how to troubleshoot your development machine, test and production environments for networking connectivity issues.
  • A network supports communication between one device to another. Sometimes, devices just do not communicate. What should we do? Understanding IT Networking and Troubleshooting for Connectivity As an application developer, I have always wondered how networking works and what their configuration means. And so I have gone on a research journey on answering my own questions and sharing them with you in this presentation from perspective of an application developer.
  • Host Generally, routers, printers, switches, hubs and modems are not considered as host in everyday networking language.
  • DNS server resolves fully qualified domain names to IP addresses – similar to a phone book. Hosts cache DNS mappings into their DNS client resolver cache. When a new host name is resolved, the host saves it in the DNS client resolver cache for a period of time. The local host file gets loaded to the DNS client resolver cache. File location: C:\\Windows\\System32\\drivers\\etc DHCP server allows for a host for automatic IP configuration for communication on a network. Centralized management for hosts to be connected to a network. As a result, two hosts won’t have the same IP address assigned. Can provide local caching of DNS resolvers. In the case where a host needs a static IP address assignment, the DHCP server can create a client reservation for an IP address based on the MAC address. For example, servers and network printers would normally have client reservations. A network interface is configured with DHCP server IP address.
  • A  firewall  is a device or set of devices designed to permit or deny network transmissions based upon a set of rules and is frequently used to protect networks from unauthorized access while permitting legitimate communications to pass. [TODO: further expansion]
  • As we have identified the basic networking devices that enable communication, TCP/IP is the “language” as to how they communicate. TCP/IP is a suite of protocols that also include UDP, ARP, ICMP, DHCP, DNS, IGMP and others. The standard for internet based communication. A protocol has header and message format. a set of rules and standards of exchanging data. can be specific to a layer in the OSI or TCP/IP model.
  • IP Address Numerical identification of a device on a network. Two components – network ID or subnet prefix and host ID Supports routing Static IP assignment is configured at one time to the network interface and is constant. Usually through manual user configuration. Dynamic IP assignment is done through a DHCP server within the network. Each time a network device is connected, a new IP address is given. Also it has a defined lease duration before a new IP address is assigned. For home networks, the router serves as a DHCP server. Windows Server has the DHCP server role feature that can be installed and serve to assign IP addresses. In a DHCP enabled network, it is best to statically assign IP addresses to routers, firewalls, servers, print servers. This is configured in the DHCP server as a ‘client reservation’. Given the MAC address of the device, one can configure an IP address within it scope. For example, if a network printer is turned on/off then it will receive a new IP address from the DHCP server, clients will not be able to print; therefore configuring for client reservation. Subnet Mask A subnet is a partition of a network. Applying the subnet mask to an IP address yields the network ID and Host ID. All hosts in a subnet work share the same network ID. MAC Address Media Access Control address (MAC address) is a unique identifier assigned to network interfaces for communications on the physical network segment. MAC addresses are hardwired to the network interface cards. 48-bit address. Default Gateway A router on a network or subnet that serves as the entry and exit point to another network. When a destination IP address does not match any routes or the subnet IP range, then the packet is sent to the default gateway for further routing.
  • http://wiki.xtronics.com/index.php/IP_Subnet_Masks#Mask_.3D_.2F25 Subnet Mask 255.255.255.192 can have 62 usable hosts per each of the 4 subnets. Network ID is 192.168.1.0 Hosts 192.168.1.0-63 192.168.1.64-127 192.168.1.128-191 192.168.1.192-255
  • [May drop this slide, but feel it is good to illustrate how subnetting works.]
  • Verify tcip/ip installation ping 127.0.0.1 Verify IP Address ipconfig /all netsh interface ip show config ipconfig /release ipconfig /renew To see IP configuration settings on a remote server netsh –r filesrv1 interface ip show config (provide username and password as part of arguments) Ping the Loopback Address 127.0.0.1 Ping 127.0.0.1 to verify that TCP/IP is working properly If you receive an error message at this point, TCP/IP (protocol) is not properly installed. Remove and reinstall TCP/IP.   Local Area Connection >  Properties > General  tab, click  Install , select  Protocol , and then click  Add . Ping Your Computer's IP Address ping <computer’s IP address>  to verify network adaptor is working properly  If you receive an error message at this point, there may be a communication problem between Windows NT and your network adapter. To correct, remove and reinstall your network adapter driver.  IP Conflict scenario If a host on a DHCP network is configured with static IP addresses manually where the IP address is already assigned by DHCP server, then an IP conflict will result. Communication is will split between the two hosts. The Event Viewer can log such events. ARP cache The address resolution protocol (ARP) cache is a list of recently resolved IP address to Media Access Control (MAC) address mappings. The MAC address is the unique physical address embedded in each network interface card. To display IP address to MAC address mappings: arp –a The ARP cache may have old mappings and hinder connectivity. To clear arp cache: arp –d Situation: If two switches are patched or have direct connection, the ARP tables can refer to one another creating a loop.
  • Verify tcip/ip installation ping 127.0.0.1 Verify IP Address ipconfig /all netsh interface ip show config ipconfig /release ipconfig /renew To see IP configuration settings on a remote server netsh –r filesrv1 interface ip show config (provide username and password as part of arguments) Ping the Loopback Address 127.0.0.1 Ping 127.0.0.1 to verify that TCP/IP is working properly If you receive an error message at this point, TCP/IP (protocol) is not properly installed. Remove and reinstall TCP/IP.   Local Area Connection >  Properties > General  tab, click  Install , select  Protocol , and then click  Add . Ping Your Computer's IP Address ping <computer’s IP address>  to verify network adaptor is working properly  If you receive an error message at this point, there may be a communication problem between Windows NT and your network adapter. To correct, remove and reinstall your network adapter driver.  IP Conflict scenario If a host on a DHCP network is configured with static IP addresses manually where the IP address is already assigned by DHCP server, then an IP conflict will result. Communication is will split between the two hosts. The Event Viewer can log such events. ARP cache The address resolution protocol (ARP) cache is a list of recently resolved IP address to Media Access Control (MAC) address mappings. The MAC address is the unique physical address embedded in each network interface card. To display IP address to MAC address mappings: arp –a The ARP cache may have old mappings and hinder connectivity. To clear arp cache: arp –d Situation: If two switches are patched or have direct connection, the ARP tables can refer to one another creating a loop.
  • Default Gateway ipconfig to display default gateway IP address. Ping default gateway to verify connectivity. If error, then router is not connected, turned off, or hardware failure. Subnet Mask A wrong subnet can disrupt communication from one host to another. If a subnet mask of a host is “within” the subnet mask of another host and the router’s, then the other host can communicate to the first. Example, PC1 can communicate with PC2 PC1 - 192.168.1.10 /24 PC2 - 192.168.1.210 /25 Default Gateway - 192.168.1.1 /24 Wrong subnet mask effect on a host - https://learningnetwork.cisco.com/message/75037 If you have PC1 and PC2 on 192.168.1.0 /24 network and you have PC3 and PC4 on the 192.168.2.0 /24 network, you can attach them all to the same switch and PC1 will communicate with PC2 and PC3 will communicate with PC4 because the rules are all correct. But, PC1/PC2 can't communicate with PC3/PC4 because they are located on different subnets and require routing.
  • Connecting to other via ping command ping <computer IP address> If ‘request timed out’ possible issue with router(s), intermediate network devices or target host. Note: a host may deny ping (ICMP) requests as a security measure (on the internet). Verify Persistent Route Table Entries All computers have a route table to route packets to neighboring nodes. Route table is automatically rebuilt at reboot. route -print to display route table. A persistent route may be old or incorrect. route –print netstat –r To clear, route –f [Route tables shouldn’t be a problem area.] TCP/IP Routing Basics for Windows NT - http://support.microsoft.com/kb/140859/EN-US Verify reachability with intermediate routers Troubleshoot whether it is a router issue rather than a target host issue. tracert <IP address> reports each router or gateway crossed by a TCP/IP packet on its way to another host.  Possible firewall or proxy blocking packet. Note: a router may deny ping (ICMP) requests as a security measure (on the internet).
  • Connecting to other via ping command ping <computer IP address> If ‘request timed out’ possible issue with router(s), intermediate network devices or target host. Note: a host may deny ping (ICMP) requests as a security measure (on the internet). Verify Persistent Route Table Entries All computers have a route table to route packets to neighboring nodes. Route table is automatically rebuilt at reboot. route -print to display route table. A persistent route may be old or incorrect. route –print netstat –r To clear, route –f [Route tables shouldn’t be a problem area.] TCP/IP Routing Basics for Windows NT - http://support.microsoft.com/kb/140859/EN-US Verify reachability with intermediate routers Troubleshoot whether it is a router issue rather than a target host issue. tracert <IP address> reports each router or gateway crossed by a TCP/IP packet on its way to another host.  Possible firewall or proxy blocking packet. Note: a router may deny ping (ICMP) requests as a security measure (on the internet).
  • Verify DNS Configuration nslookup <DNS server IP address> Queries DNS server to resolve host name to IP addresses. Note that the local host file overrides DNS lookups, but nslookup does not consider the host file. Although a host reachable by IP, it may not be reachable by host name or a FQDN. This would be due to DNS server issues. Verify through ipconfig /all that the DNS server IP address is correct. netsh interface ip show dns  ping the DNS server by IP address. Verify DNS server on the network. To re-register the local computer in the DNS database on name servers. What this means is that all DNS names for the local computer are first released and then renewed in the DNS database (assuming you have an Active Directory network that uses Dynamic DNS or DDNS for registering DNS names in the database). ipconfig /registerdns Verify DNS client resolver cache Verify DNS entries ipconfig /displaydns In the event of DNS configuration changes, may need to flush the DNS client resolver cache. Clear cache ipconfig /flushdns NetBIOS NetBIOS name resolution means successfully mapping a NetBIOS name to an IP address. A NetBIOS name is a 16-byte address that is used to identify a NetBIOS resource on the network. A NetBIOS name is either a unique (exclusive) or group (nonexclusive) name. When a NetBIOS process is communicating with a specific process on a specific computer, a unique name is used. When a NetBIOS process is communicating with multiple processes on multiple computers, a group name is used. To reload remote cache name table nbtstat -r Host File File location: %SystemRoot% \\system32\\drivers\\etc\\hosts  DNS client resolver cache is populated with the host file entries along with DNS server records Host file entries override DNS entries. The nslookup command does not resolve entries in the host file.
  • Check Packet Filtering or Firewall Rules Verify TCP Session Establishment Although a remote host is reachable by ping tool, verify TCP connection. telnet <IP address> <TCP Port>
  • Check Packet Filtering or Firewall Rules Verify TCP Session Establishment Although a remote host is reachable by ping tool, verify TCP connection. telnet <IP address> <TCP Port>
  • http://sourcedaddy.com/windows-7/troubleshooting-network-issues.html
  • Networking For Application Developers by Roy Kim

    1. 1. IT Networking for Application Developers Presenter: Roy Kim [email_address] blog: roykimsharepoint.wordpress.com
    2. 2. Agenda <ul><li>Benefits of IT Networking Knowledge </li></ul><ul><li>Networking Fundamentals </li></ul><ul><li>Troubleshooting Network Devices </li></ul><ul><li>Troubleshooting Tools </li></ul>[email_address] [email_address]
    3. 3. Benefits of Networking Knowledge <ul><li>Interface with IT administrators and IT architects. </li></ul><ul><ul><li>Know how to ask the right questions. </li></ul></ul><ul><li>Understand development machine and testing environments. </li></ul><ul><ul><li>Faster issue/resolution cycles with IT </li></ul></ul><ul><ul><li>Fix your own problems </li></ul></ul><ul><li>Become a well-rounded Technology Architect </li></ul><ul><ul><li>Core fundamental </li></ul></ul><ul><ul><li>Design application architecture with IT touch points in mind </li></ul></ul>[email_address] [email_address]
    4. 4. Network Diagram DMZ Internet [email_address] [email_address] Switch Hosts Router Subnet Firewall Security
    5. 5. Network Fundamentals <ul><li>Node </li></ul><ul><ul><li>Any device on a network </li></ul></ul><ul><li>Host </li></ul><ul><ul><li>Participate in applications in a client server model on a network. </li></ul></ul><ul><li>Switch </li></ul><ul><ul><li>Routing traffic within a network between hosts. </li></ul></ul><ul><li>Subnet </li></ul><ul><ul><li>A partition of a network that share the same network ID or subnet prefix. A grouping of network traffic into sub networks. Mitigate network congestion. </li></ul></ul><ul><li>Router </li></ul><ul><ul><li>Routing IP traffic between networks and subnets </li></ul></ul>[email_address] [email_address]
    6. 6. Network Fundamentals <ul><li>Domain Name Resolution (DNS) Server </li></ul><ul><ul><li>Host Name Resolution service </li></ul></ul><ul><ul><li>Translate host name to IP Address </li></ul></ul><ul><ul><li>DNS client resolver cache </li></ul></ul><ul><li>Dynamic Host Configuration Protocol (DHCP) Server </li></ul><ul><ul><li>Automatic assignment of an IP address to a network device. </li></ul></ul><ul><ul><li>Client IP reservation - Offers static assignment e.g. Network Printers </li></ul></ul>[email_address] [email_address]
    7. 7. Network Fundamentals <ul><li>Firewall </li></ul><ul><ul><li>Allow or deny network traffic on the inbound or outbound communication </li></ul></ul><ul><ul><li>Network Security Management </li></ul></ul><ul><ul><li>Packet Filter </li></ul></ul><ul><ul><li>Application firewall </li></ul></ul><ul><ul><li>Network address translation </li></ul></ul><ul><ul><li>Proxies </li></ul></ul><ul><ul><li>Load Balancer </li></ul></ul><ul><ul><li>E.g. Microsoft Threat Management Gateway </li></ul></ul>[email_address] [email_address]
    8. 8. TCP/IP Protocol Suite <ul><li>Transmission Control Protocol/Internet Protocol </li></ul><ul><li>The suite of communications protocols used to connect hosts on the Internet. </li></ul>[email_address] [email_address]
    9. 9. Hosts: TCP/IP Configuration IP Address MAC Address Subnet Mask Default Gateway DNS Server DHCP Enabled DHCP Server 192.168.1.100 00-50-56-C0-00-01 255.255.255.0 192.168.1.1 192.168.2.101 Yes 192.168.2.200 [email_address] [email_address]
    10. 10. Subnetting DMZ Internet Subnet Mask 255.255.255.192 or CIDR /26 Network ID 192.168.1.0 10.21.128.1 [email_address] [email_address] 192.168.1.128 192.168.1.0 192.168.1.64 192.168.1.2 192.168.1.3 192.168.1.4 192.168.1.5 Hosts: 192.168.1.66-126 Hosts: 192.168.1.29-190 192.168.1.1 192.168.1.65 192.168.1.129
    11. 11. <ul><li>Subnetting </li></ul>[email_address] [email_address] Binary form Dot-decimal notation IP address 11000000.10101000.00000101.10000010 192.168.5.130 Subnet mask 11111111.11111111.11111111.00000000 255.255.255.0 Network prefix 11000000.10101000.00000101.00000000 192.168.5.0 Host part 00000000.00000000.00000000.10000010 0.0.0.130 Binary form Dot-decimal notation IP address 11000000.10101000.00000101.10000010 192.168.5.130 Subnet mask 11111111.11111111.11111111. 11 000000 255.255.255.192 Network prefix 11000000.10101000.00000101.10000000 192.168.5.128 Host part 00000000.00000000.00000000.00000010 0.0.0.2
    12. 12. Troubleshooting Areas <ul><li>Network Interface </li></ul><ul><ul><li>IP Address (DHCP) </li></ul></ul><ul><ul><li>ARP Cache </li></ul></ul><ul><li>Subnet or Routers or Host </li></ul><ul><ul><li>Route table </li></ul></ul><ul><li>Host Name Resolution </li></ul><ul><ul><li>DNS Server </li></ul></ul><ul><ul><li>DNS client resolver cache </li></ul></ul><ul><ul><li>Host file </li></ul></ul><ul><li>Firewall </li></ul>[email_address] [email_address]
    13. 13. Troubleshooting Connectivity <ul><li>IP Addressing </li></ul><ul><ul><li>To display, </li></ul></ul><ul><ul><ul><li>ipconfig /all </li></ul></ul></ul><ul><ul><ul><li>netsh interface ip show config </li></ul></ul></ul><ul><ul><li>To verify, </li></ul></ul><ul><ul><ul><li>ping loopback address 127.0.0.1 </li></ul></ul></ul><ul><ul><ul><li>ping <host IP Address> </li></ul></ul></ul><ul><ul><li>To clear IP address, ipconfig /release </li></ul></ul><ul><ul><li>To get new IP address from DHCP, ipconfig /renew </li></ul></ul><ul><ul><li>IP conflict scenario </li></ul></ul><ul><ul><li>To clear, arp -d </li></ul></ul>[email_address] [email_address]
    14. 14. <ul><li>ipconfig </li></ul>[email_address] [email_address]
    15. 15. Troubleshooting Connectivity <ul><li>Arp cache </li></ul><ul><ul><li>To display, arp –a </li></ul></ul><ul><ul><li>To clear, arp -d </li></ul></ul>[email_address] [email_address]
    16. 16. Troubleshooting Connectivity <ul><li>Subnet Mask </li></ul><ul><ul><li>To display, ipconfig /all </li></ul></ul><ul><ul><li>Can set manually in Local Area Connection properties. </li></ul></ul><ul><li>Default Gateway </li></ul><ul><ul><ul><li>To display, ipconfig /all </li></ul></ul></ul><ul><ul><ul><li>Can set manually in Local Area Connection properties. </li></ul></ul></ul>[email_address] [email_address]
    17. 17. Troubleshooting Connectivity <ul><li>Verify reachability to another host </li></ul><ul><ul><li>ping <remote IP address> </li></ul></ul><ul><li>Verify Route Table entries </li></ul><ul><ul><li>To display, route print </li></ul></ul><ul><ul><li>To clear, route –f </li></ul></ul>[email_address] [email_address]
    18. 18. Troubleshooting Connectivity <ul><li>Verify reachability for intermediate routers </li></ul><ul><ul><li>tracert <remote IP address> </li></ul></ul><ul><ul><li>pathping <remote IP address> </li></ul></ul>[email_address] [email_address]
    19. 19. Troubleshooting Host Name Resolution <ul><ul><li>DNS Server </li></ul></ul><ul><ul><ul><li>Verify DNS server response, nslookup <hostname/FQDN> </li></ul></ul></ul><ul><ul><ul><li>Verify DNS Server setting, ipconfig /all </li></ul></ul></ul><ul><ul><ul><li>ping <DNS server IP> </li></ul></ul></ul><ul><ul><ul><li>ipconfig /registerdns </li></ul></ul></ul><ul><ul><li>DNS client resolver cache </li></ul></ul><ul><ul><ul><li>To display, ipconfig /displaydns | more </li></ul></ul></ul><ul><ul><ul><li>ipconfig /flushdns </li></ul></ul></ul><ul><ul><ul><ul><li>Flushes the contents of the DHS resolver cache on the local computer. Pre-loads any entries in the HOSTS file into the cache. </li></ul></ul></ul></ul><ul><ul><li>NetBIOS </li></ul></ul><ul><ul><ul><li>To display cache, nbtstat -c </li></ul></ul></ul><ul><ul><li>Host file </li></ul></ul><ul><ul><ul><li>Location: %SystemRoot%system32driversetchosts  </li></ul></ul></ul><ul><ul><ul><li>DNS client resolver cache includes host file entries </li></ul></ul></ul>[email_address] [email_address]
    20. 20. Troubleshooting Firewall Rules <ul><ul><li>Blocks inbound and/or outbound tcp/ip traffic </li></ul></ul><ul><ul><li>Client side vs Server side firewall </li></ul></ul><ul><ul><li>Verify communication/connectivity in front or behind firewall. </li></ul></ul><ul><ul><li>Verify if other clients can connect </li></ul></ul><ul><ul><li>View firewall rules </li></ul></ul>[email_address] [email_address]
    21. 21. Troubleshooting TCP Ports <ul><ul><li>Display ports’ state and PID, netstat –ano </li></ul></ul><ul><ul><li>Display applications and ports listening, netstat –b </li></ul></ul><ul><ul><li>Verify tcp port connectivity, telnet <IP address> <TCP Port> </li></ul></ul>[email_address] [email_address]
    22. 22. Tools Summary [email_address] [email_address] Tool Description Arp Allows viewing and editing of the Address Resolution Protocol (ARP) cache. Hostname Displays the host name of the computer. Ipconfig Displays the current TCP/IP configuration for both IPv4 and IPv6. Also used to manage Dynamic Host Configuration Protocol (DHCP)-allocated IPv4 address configurations, display or flush the DNS client resolver cache, and register DNS names. Netsh Configuration tool for many network services. For each network service, there is a context containing commands specific for that service. For the  netsh interface ip  contexts, displays and administers TCP/IP protocol settings on either the local computer or a remote computer. Netstat Displays protocol statistics and information on current TCP connections. Nslookup Performs DNS queries and displays the results. Ping Sends Internet Control Message Protocol (ICMP) Echo or Internet Control Message Protocol for IPv6 (ICMPv6) Echo Request messages to test reachability. Route Allows viewing of the IPv4 and IPv6 routing tables and editing of the IPv4 routing table. Tracert Sends ICMP Echo or ICMPv6 Echo Request messages to trace the network route taken by IPv4 or IPv6 packets to a specific destination. Pathping Sends ICMP Echo or ICMPv6 Echo Request messages to trace the route an IPv4 or IPv6 packet takes to a destination and displays information on packet losses for each router and link in the path. Event Viewer Records errors and events. Performance Logs and Alerts Logs TCP/IP core protocol performance and sends alerts (the SNMP service must be installed). Network Monitor Captures and displays the contents of TCP/IP packets sent to and from computers running Windows Server 2003. Telnet Tests TCP connection establishment between two nodes.

    ×