Is there a wiki or book, which explains what happens when user enters a link in the browser, and how the dns is resolved, how the router finds the route to the host etc.. I am mainly interested in routing the packets.

This is a somewhat detailed overview of the process. I am eliding some specifics on the routing. The actual routing decision isn't that interesting, it "just" boils down to finding the most specific route (255.255.255.0 is a more specific netmask than 255.0.0.0). In routing terms, the interesting bit is how routing information is propagatated through the network(s)).

User enters http://www.example.com/ in browser.

The browser uses either its own resolver lib or libresolv

The resolver library queries the host-defined name-server(s)

The name-server either knows the answer, looks it up on behalf of the host or says "ask the root name server".

The name servers may recure up to the root servers and ask for the name servers that serve the com. domain

then ask who servers the example.com. domain

then ask for the IP address of www.example.com

The browser initates a TCP connection (sends a TCP SYN) to the IP address of www.example.com.

The host looks in its routing table for the next hop for that IP address, then sends an IP frame, with the TCP SYN embedded, with its own IP as the source and the address of www.example.com as the destination. This is embedded in an ethernet frame with the source MAC of the outbound interface of the host and a destination MAC of the next-hop gateway.

The default gateway receives the frame, increments TTL, re-computes the checksum and sends it on to the next hop.

This process continues until the IP packet reaches the router closest to www.example.com

At that point, the router sees that it is destined for a local network. It consults its ARP table to see if it has an IP-to-MAC mapping for the destination.

If not, it sends an ARP request, to resolve the MAC address for the IP address.

The www.example.com host receives the TCP SYN, sends a TCP SYNACK as response.

The network traversal happens as above, only "in reverse".

The user host respons with a TCP ACK.

When the TCP ACK arrives at www.example.com, the host OS notifies the web server that 14. there is a waiting connection.

The user host sends a HTTP GET request

The server host passes the HTTP GET to the web server process.

The web server process responds with one or more packets with the web page.

The user host passes this traffic to the browser.

The browser parses the HTML and displays the page to the user (there may be more requests initiated, if there are CSS documents referenced, images referenced or other linked documents that may be needed for a complete render)