# Network Fundamentals Moving data from one device to another. #### OSI - Open Systems Interconnect - *Application Layer* : HTTP/HTTPS - *Presentation* : (Antiquated) - *Session Layer* : (Antiquated) - *Transport Layer* : TCP - *Network Layer* : Addressing Scheme(IP Addressing, IP Routing) - *Data Link Layer* : Ethernet (Device to router, router to cable modem. ) Ethernet allows high speed communication, - *Physical Layer* : Twisted Pair, CoAx, Fiber Optics, Wirless - DOCSIS-3 = **Data Over Cable Service Interface** Specification Ethernet is a family of wired computer networking technologies commonly used in local area networks, metropolitan area networks and wide area networks. It was commercially introduced in 1980 and first standardized in 1983 as IEEE 802.3 **Protocol Categories** - Data Transfer Protocol - Authentication Protocols - Network Service Protocols - Network Management Protocols - Audio/Visual Protocols **Hyper Text Document Transfer** ``` Layer 7 HTTP HTTPs Layer 4 80 443 ``` **File Transfer** *SMB*: Server Message Block. (Network file share) ``` Protocol |FTP | sFTP | TFTP | SMB | Port |20/21 | 22 | 69 | 445 | ``` **Email** POP3 - Post Office Protocol v3 IMAP - Internet Message Access Protocol SMTP - Sends message from client to email server. Server sends to receipient. ``` Protocol |POP3 |IMAP |SMTP | Port |110/995 |143/993 |587/25/465 | ``` **Authentication** LDAP - Lightweight Directory Access Protocol LDAP LDAPs 389 636 **Network Services** **DHCP** Dynamic Host Configuration Protocol When we plug-in to the network DHCP automatically hands out IP address to it. It is typically the wireless access point for your home network. Port 67/78 //Flow below Work Station --> Message --> DHCP SErver DHCP Server --> IP Address, Sunebet , Default Gateway, DNS Server **DNS** is to lookup hostname into an ip address. uses port 53 nslookup command. * * * **NTP :Network Time Protocol** UTC : Coordinated Universal TimeNT Controlled by Governments. Imaginary Line from NP to South pole . Greenwhich (East London). Prime Meridian. Time at Midngight is considered as 0 hour. Midnight in Greenwhich is 5:30 in the morning New Delhi. UTC Greenwich Mean Time - GMT is a Time zone UTC is a time Standard. This means that no country or territory officially uses UTC as a local time. **Network Management Protocols** Telnet - Clear Text. Operates on Port 23 SSH - Secured Shell (Encrypted) . Port 22 SNMP - Simple Network Management Protocols. SNMP Server --> Walk the tree and get all the information about clients in the network. Network admin can look in to the SNMP Server can look in to the SNMP server. SNMP Trap --> If something breaks client can send can send SNMP Trap to SNMP server. RDP --> Remote Desktop Protocol. port 3389 **Audio Visual** H.323 1720/`1721` --> Used for Video conferencing. H For Voice call using VOIP , SIP protocol is used. SIP stands for Session Initiation Protocol. SIP Uses 5060/5061 Ports. Used to setup a voice call. *** Transport Layer (Layer 4) TCP TCP - Transmission Control Protocol **3 way handshake** Client --> SYN --> Server Server --> SYN-ACK --> Client Client --> ACK --> Server **4 Way Disconnect (Graceful DIsconnect)** Server --> FIN --> Client Client --> FIN-ACK --> Server Client --> FIN --> Server Server --> FIN-ACK -->Client TCP Reset // hanging up abrutptly RST **UDP** User Datagrapm Protocol No session, no three way handshake Used for efficient data transfer. **Transport Layer Addressing** Port # Source Port# and Destination Port# Port# are catgorized in to two Server / Wellknown / Registered port Client / Ephemeral Port numbers. * * * IP Addressing *** IP Addressing is at layer 3 IP Address borken in to 4 portions. Each portion range 0-255 Network portion + host portion Each one of these 4 numbers are decimal representation of binary numbers. An IP address is a 32 bit value broken in to 4 octects. **Classful Addressing (Before 1995)** Class A , B, C --> Unicast addersses. Class D --> Multicast address. One to many devices. NOt suported on internet. **Classless Addressing (1995 to present)** First 3 octects are Netwrok portion and last octect portion is host portion all binary 1 for network octects and all binary 0s for host portion => Subenet mask. The netwrok designer can choose how many bits (out of 32 bits) they want to assign for the network portion and how many bits for the host portion. IP Address 192.168. 4. 57 Subnet Mask 255.255.255. 0 This means, the first three octects represents network portion. First Address of the subnet is netowrok address 192.168.4.0 Last Address of the subnet is BroadCast address 192.168.4.255 So out of 256 the above two are gone and you are left with 254 hosts. **Address Types** An IP netwrok has three types of Addresses. Network Address, Broadcast address and Host Address. **Network Address** // Compare to Zip Code - Identifier for a group of devices. - Network Prefix if we have a subnet mask and a device ip address we can find out the network addresss. The network address will have all binary zeroes in the HOST portion of the address. *Question:* If you have a network mask of 255.255.255.128 , what will be your etwork address/broadcastaddess/how many hosts Ans: Network Address will be 192.168.4.0 Broadcast address will be 192.168.4.127 you can have only 126 hosts . **Broadcast Address** // Address that can send a message to all devices at once. - Identifier for all devices on a network. - In the HOST portion all binary 1's. (Refer back to the question above) **Host Address** // Unique device - identifies unique device on a network. - Anything that is not a network address & not a broadcast address. Host address is in between Network address and broadcast address. **CIDR Notation** Classless Inter Domain Routing Look at the subnet mask below and equivalent binary. ``` 255 255 255 0 11111111 11111111 11111111 00000000 ``` First 3 octets is the network prefix and it is 24 bits. The number of bits in the network portion will be represented by /24. Example: 203.0.113.10/24 **Private Addresses** Internal Private Use only. Determined by IETF (Internet Engineering Task Force) is the authority. IPv4 addresses are allocated by IANA(Internet Assigned Numbers Authority) RFC 1918 ``` 10. 0. 0. 0 to 10. 255 .255 .255 00001010.00000000.00000000.00000000 to 00001010.11111111.11111111.11111111 // above is in a /8 subnet. 172. 16. 0. 0 to 162. 31. 255. 255 10101100.10100010.00000000.00000000 to 10100010.00011111.11111111.11111111 // above is a /12 subnet 192. 168. 0. 0 to 192. 168. 255. 255 11000000.10101000.00000000.00000000 to 11000000.10101000.11111111.11111111 //above is in a /16 subnet ``` **APIPA** - Automatic Private IP Addressing. 169.254.0.0/16 . Windows uses APIPA addresses to help non technical users. If a device has this address this means there is a problem in the network. **Loopback Address** 127.0.0.1 to check if your IP stack on your OS works correctly. ``` A loopback address is a special IP address, 127.0.0.1, reserved by InterNIC (The Network Information Center) for use in testing network cards. This IP address corresponds to the software loopback interface of the network card, which does not have hardware associated with it, and does not require a physical connection to a network. The loopback address allows for a reliable method of testing the functionality of an Ethernet card and its drivers and software without a physical network. It also allows information technology professionals to test IP software without worrying about broken or corrupted drivers or hardware. ``` **PING** - Packet InterNet Groper. Sends a packets to an ip address send back a response if IP is working. Inordedr for two devices to communicate each device should be on the same IP network. If they are on different network we need to use router. **Components of a IP Network** Network IP Address: All binary 0's in host portion. Broadcast IP Address: All binary 1's in host portion Host IP Address Network 10.0.0.0/8 Range 10.0.0.0 - 10.255.255.255 Subnet from the above subnet Network 10.0.10.0/24 Range 10.0.10.0 - 10.0.10.255 VLSM - Variable Length Subnet Masking **IP v6** Bit - 1 OR 0 Nibble - 4 bits - 1010 - Hex - 0xA Byte - 8 Bits - 11111111 - Hex Hextet - 16 bits IP v6 Address listed as hextets 128 bits long = 32 nibbles = 8 hextets. First 64 bit Network Portion Latter 64 bit is interface identifier SLAAC -- Stateless Adress Auto Configuration **ETHERNET & Switching** CSMA/CD Carrier Sense Multiple Access with Collision Detetction Collission Domains Duplex & Speed Half Duplex. Eg: Walkie / Talkie Full Duplex: Eg: Telephone Ethernet Frame Switch Operation **Network Topologies** - Bus - Antiquated. (Single wire) - Ring - Antiquated (Token Ring) - Star - Modern - Layer2 Switch - Keep track of mac address in mac address table. - Frame header. **Switching Features** Broadcast Domain : *Receive a message with all Fs in the mac address. Broadcast messages will be send out to all active interfaces. If there are two switches this can lead to Broadcast Storm: Multiple switches causing too much broadcast traffic.Solved by Spanning Tree Protocol. Shutdown redundancy* Home switches does not have spanning tree implemented. Only enterprise has this. **VLAN** Each broadcast domain a VLAN Up to 4000 VLANs on a single switch. Trunk Link --> designed to connect switches **IP Routing** IP Routing happens at Network Layer (Layer 3) Respnoseible for End to end communication. Routers will have at least two interfaces. IP Packet Internet Control Message Protocol ``` Destination MAC Source MAC Layer3 Protocol Source IP Destination IP TTL Other ICMP ``` TTL is used to prevent loops in Layer 3 Destination MAC address is obtained with the help of **Address Resolution Protocol** (ARP). Devices maintain ARP Cache (Table. 90 seconds) NOTE: MAC Address table is purely on Layer 2. Exists only on switch. Default Gateway : Gateway is another term for Router. Dynamic Routing - RIP - Antiquated (Actually RIP) - EIGRP - Enhanced Interior Gateway Routing Protocol - OSPF - Open Shortest Path First - BGP - Border Gateway Protocol **Layer 1 topologies** LAN - Local Area Network WLAN - Wireless LAN WAN - WIde Area Network - CAN Campus Area Network (Silicon Valley as example) - MAN Metropolitan Area Network () SAN - Storage Area Network PAN - Personal Area Network (Bluetooth) **NAT** Network Address Translation :abc: Protocol-Port Mapping ``` Category Protocol Port Descritpion Data Transfer HTTP 80 Hyper Text Transfer Protocol HTTPs 443 Hyper Text Transfer Protocol (Secured) FTP 20/21 File Tansfer Protocol sFTP 22 Secured File Tansfer Protocol TFTP 69 Trivial File Transfer Protocol. SMB 445 Server Message Block. (Used in Mapped Network Drive) POP 3 110/995 Post Office Protocol v3. (Email incoming) IMAP 143/993 Internet Message Access Protocol (Email Incoming) SMTP 25/465/587 Simple Mail Transfer Protocol (Email Outgoing) Authentication LDAP 389 Lightweight Directory Access Protocol LDAPs 636 Network Service DHCP 67/68 Dynamic Host Configuration Protocol DNS 53 Lookup hostname into an ip address. NTP 123 Network Time Protocol Network Management Telnet 23 Shell (clear text) SSH 22 Secured Shell (Encrypted) SNMP 161/162 Simple Network Management Protocol RDP 338 Remote Desktop Protocol Audio Visual H.323 1720/1721 Video Conference SIP 5060/5061 Voice Call (VOIP) ```