Post

Interview_IP address

πŸ“Œ IP address


βœ… What is IP address? - address for each device connected to network


βœ… Two parts of IP address? - network part βž• host part
- network partκ°€ κ°™λ‹€λ©΄ 같은 λ„€νŠΈμ›ŒνŠΈ ➑️ switch, bridge, hub
- network partκ°€ κ°™λ‹€λ©΄ λ‹€λ₯Έ λ„€νŠΈμ›ŒνŠΈ ➑️ router
- each device has unique host address


βœ… If devices are on different network, how does it communicate? - through router
- router creates broadcast domain


βœ… What is the difference between IPv4 and IPv6? - IPv4: 32bit binary(total 2^32)/ 8 * 4parts/ in decimal, seperate with .
- IPv6: 128bit binary(total 2^128)/16 * 8parts/ in hexadecimal, seperate with :


βœ… How are the classes of IP address? - class A: network 8 + host 24, start with 0
- class B: network 16 + host 16, start with 10
- class C: network 24 + host 8, start with 110
- class D, E


βœ… What is CIDR? - Classless Interdomain Routing
- devide network part, host part of IP address more flexibily than class


πŸ“Œ MTU

βœ… What is MTU? - Maximum Transmission Unit
- Max data that can be sent
- differs on protocol, link
- ⭐️ fragmentation, reassembly


βœ… What is in MTU header? - ID
- flag
- offset


πŸ“Œ Subnet, Subnet Mask

βœ… What is Subnet? - small isolated part of network


βœ… Why do we have to make network into smaller subnets? - If we use IP address as recieved, broadcast domain is too big
- If broadcast domain is too big, more network load


βœ… What is subnet mask? - use subnet mask to distinguish IP address into network part and host part
- 1: network part, 0: host part
- example: /20 means first 20 binary numbers are network part


βœ… Why do we use subnet mask? - 1. Make network into smaller subnets
- 2. Save IP address


βœ… What is broadcasting? - one way to trasnmit data from node to node
- one node to all nodes
- exmaple: ARP, DHCP

- πŸ‘ŽπŸ» lot of network traffic, as message is sent to every node in network
- πŸ‘ŽπŸ» less secure

- πŸ†š unicast: point to point
- πŸ†š multicast: multiple point to point


βœ… If subnet mask is /24, how many hosts can be on network? - 32-24 = 8
- 2^8-2
- 000000: for network address
- 111111: for broadcast address
- others can be used for device IP address, gateway


πŸ“Œ Routing

βœ… What is a router? - route network traffic
- create broadcast domain
- OSI layer 3
- use IP address to route data
- has routing table


βœ… What is broadcast domain? - when not knowing IP address, send to all device on broadcast domain "who"?


βœ… What is routing? - route network traffic among different network
- look at IP address network part
- If network part is differnet, has to go through router


βœ… What is gateway? - to access totally dissimilar network
- access control


πŸ“Œ Routing Protocol

βœ… What is routing protocol? - protocol to decide how to route data packet from src to dest
- find best route
- update routing table

βœ… Distance Vector Routing Protocol
- select path on hop counts
- RIP
- hop count: how many router between src and dest?

βœ… Link State Vector Protocol
- every node constructs a map of the connectivity of network in form of graph
- which node is connected to which
- more about internetwork
- OSPF

βœ… Advanced Distance Vector Routing Protocol
- hybrid routing protocol
- EIGRP

⭐️ RIP
- Routing Information Protocol
- maximum hop: 15, not suitable for big networks

⭐️ OSPF
- Open Shortest Path First
- caculate shortest path spanning tree

⭐️ IGRP - Interior Gateway Protocol
- more than 15 hops, maximum hop: 255 - suitable for larger networks
⭐️ EGP
- Exterior Gateway Protocol

⭐️ EIGRP
- Enhanced Interior Gateway Routing Protocol
⭐️ BGP
- Border Gateway Protocol
- replaced EGP


βœ… What is DHCP? - Dynamic Host Configuration Protocol
- DHCP server automatically assigns IP address when new host joins a network
- client-server based
- message ➑️ request ➑️ response with IP address
- when host sends DHCP message, use broadcasting


βœ… How is IP address assigned? - Static Assignment: manually assign static IP
πŸ‘πŸ» can predict network
πŸ‘πŸ» address is static, doesnt change
πŸ‘ŽπŸ» difficult to manage, address collision
πŸ› οΈ printer, server, important network devies
- Dynamic Assignment: automatically assign dynamic IP addressby DHCP
- only valid for limited time, need revalidation
πŸ‘πŸ» automatic πŸ‘πŸ» easy to manage, prevent address collision πŸ‘ŽπŸ» IP address can change dynamically πŸ› οΈ


πŸ“Œ NAT, Private IP, Public IP

βœ… What is private IP and public IP? - Private IP: IP used in private network
- cannot be accessed from outside
- cannot access Internet
- Public IP: IP to access Internet


βœ… What is NAT? - Network Address Translation
- private IP ➑️ NAT ➑️ public IP
- host in private network request with private IP, port
- NAT translate into public IP, assign port
- update NAT translation table
- web server reply arrive to public IP address
- NAT translate again to private IP, send to host


βœ… What are the benefits of using NAT? - πŸ‘πŸ» security, private IP access impossible
- πŸ‘πŸ» save IP address(several private devices use one public IP address)
- πŸ‘πŸ» devices in private network can access Internet


πŸ†š Mac address

IP address πŸ†š Mac address? βœ”οΈ Mac address
- physical unique identifier on NIC card
- hardware address that is physically embedded into NIC
- OSI layer 2, switch, bridge, collision domain
- 48bit number

βœ”οΈ IP address
- logical identifier assigned to device when joining network
- OSI layer 3, router
- IPv4, IPv6

βœ”οΈ ARP
- IP address ➑️ map to Mac address


πŸ“Œ ICMP

βœ… What is ICMP? - Internet Control Message Protocol
- part of Internet Protocol
- IP does not have error reporting function
- ICMP provide error handling in network layer of OSI layer
- 1. Error Handling: if data packet did not arrive, report
- 2. Network assessment: ping
- ping: echo request message - check packet loss or delay
- (check if there is a connection between two devies)
- (measure the time to reach dest)
- traceroute: know the route between two devices


This post is licensed under CC BY 4.0 by the author.