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.