Network layer

#Network layer
* Error detection, unreliable
Best effort service,IP has a simple error handling algorithm:
throw away the datagram and try to send an ICMP message back to the source
* Host addressing

IPv6 wrl6

ip6_input or ip6_output
F1: OK
F2: OK

4.3 IP address

IPv6 wrl6
ip6_input or ip6_output
* 0:
1 ok IPV6_ADDR_LOOPBACK ::1128
2 ok IPV6_ADDR_ANY ::/128
3 ok IPV6_ADDR_MAPPED ::ffff:0:0/96
4 ? IPV6_ADDR_COMPATv4 0000::/96 ipgre_tunnel_xmit ddr_type & IPV6_ADDR_COMPATv4) == 0 ; goto tx_error_icmp;
5 G?
* 0100::/64, NG, Used by CISCO
A Discard Prefix for IPv6
Discard-Only Address Block
Remote Triggered Black Hole (RTBH)
* 0200::/7, NG, Deprecated
OSI NSAPs and IPv6
Internet Code Point (ICP) Assignments for NSAP Addresses
Interfaces between protocol layers
Network Service Access Point (NSAP): v4,v6?
* 0400::/6, NG, No information, maybe used as Global address see __ipv6_addr_type
* 0800::/5, NG, ditto
* (000, 111)x::/3, OK, unicasts. For more details please reference __ipv6_addr_type
1000::/4, OK, ditto
2000::/3, OK, Global Unicast,
2002::/16, OK, SIT, 6in4
2001::/32, OK, used in Default policy table for routing
2001:10::/28, OK, Ditto
* e000::/4, NG?, No information in google; but used as GU in and kernel by default.
* fc00::/7, OK,
* fe80::/10, OK,
* fec0::/10, OK, But deprecated by RFC3879, used in kernel?
Deprecating Site Local Addresses
* ff00::/8, OK
* addr not described in __ipv6_addr_type working as global unicast

* IP Packet Fragmentation/Defragmentation
* MSS tcp_sock->mss_cache in tcp_sync_mss not minus SACK option
in tcp_current_mss minus SACK option
+ IP option is fixed in a session icsk->icsk_ext_hdr_len;
+ is network header icsk->icsk_af_ops->net_header_len
+ tcp_sock->tcp_header_len all except SACK option (Not sure)
What’s wrong with IPv4 and Why we are moving to IPv6

Classless Inter-Domain Routing

CIDR is a method for allocating IP addresses and routing Internet Protocol packets.
IETF introduced CIDR in 1993 to replace the classful network.
* prefix/length
* Prefix aggregation

prefix/route aggregation
decrease the memroy and the time of search route table.

Private network

In the Internet addressing architecture, a private network is a network that uses private IP address space.

##IP fragmention/defragmention
iphdr->id, iphdr->frag_off
Updated Specification of the IPv4 ID Field


ip_append_data 和ip_push_pending_frames弄frag_list
ip_push_pending_frames -> __ip_make_skb & ip_send_skb ->ip_local_out
把&sk->sk_write_queue上的数据最后编程skb链表变成了, 还skb pull掉了潜在的ip 头部
第一个skb->frag_list的成员. 用的不太多啊.
ip_append_data中间出了以为如果可以ufo 那么就到frags的碗里去!