4 ms·
Can I ask a pretty newbie question - how is BGP connected to IP, TCP and DNS protocols? Is it sitting "below" them, "on top" of them, or is it somewhere else?
by runn1ng 14y ago
Can I ask a pretty newbie question - how is BGP connected to IP, TCP and DNS protocols? Is it sitting "below" them, "on top" of them, or is it somewhere else?
- ef4 14y agoBGP runs on top of TCP, which runs on top of IP. DNS runs on top of UDP (or sometimes TCP), which runs on top of IP. Edited to elaborate: most computers on the internet don't need to know anything about BGP. It's not directly involved when you establish connections. Think of it as an automatic configuration system running on the various routers.
- pilom 14y agoSaying BGP runs on top of IP is true but doesn't tell you what BGP does or how Global scale IP doesn't work without BGP. BGP is the protocol Internet Routers (i.e. not your home router) use to figure out how to route IP addresses to particular routers. So your home router connects to an internet router at comcast (or your ISP). The Comcast router announces to the rest of the world "Dear world, if you want to connect to any of the IP addresses at X.X.X.X sent those packets to me and I'll deal with them."
- jemfinch 14y agoFirst, TCP and DNS don't come into it: they both piggyback on IP (TCP directly; DNS via UDP in typical use), so IP is all that's really relevant. BGP is how routers communicate with each other. Every major edge router for a network is typically connected to many other edge routers for other networks. Each router announces what amounts to their complete routing table: i.e., for every IPv4/IPv6 address that they know how to route, they announce what networks it traverse on the way to the destination. When a router is deciding which router an IP packet should hop to next, it looks at the packet's destination IP address and consults an in-memory data structure that it has constructed based on the BGP announcements of the routers to which it's connected. Modulo refining nuances (MED/PREF), it looks for two things: 1. It routes the packet according to the most specific network it saw announced. If it sees a packet destined for 1.2.3.4, and one connected router A is announcing a route for 1.2.3.0/24, and another connected router B is announcing a route for 1.2.0.0/16, it will pass along the packet to router A, all other things being equal. 2. As a tiebreaker for announcements with the same network specificity, it looks at the "AS path": the set of networks that the packet will traverse. It picks the router with the shortest path: the least number of traversed networks. So the answer to your direct question is that BGP is "somewhere else": it's what routers use to communicate to each other "How will you route this IP packet?" and then make reasonable decisions about how they should send packets around the network.
- count 14y agoTo be clear - BGP runs on TCP port 179, so it sits in TCP segments, and those are inside IP packets.
- zrail 14y agoBGP is comprised of long lived TCP connections between routers. The IP of the other router is well known and hard coded in the config afaik but I'm not a network engineer.
- ColinWright 14y agohttp://www.tcpipguide.com/free/t_TCPIPExteriorGatewayRoutingProtocolsBGPandEGP.htm http://www.tcpipguide.com/free/t_TCPIPExteriorGatewayRouting...
- brianpan 14y agoBGP and DNS run on TCP which runs on IP. http://en.wikipedia.org/wiki/Internet_protocol_suite http://en.wikipedia.org/wiki/Internet_protocol_suite http://en.wikipedia.org/wiki/OSI_model http://en.wikipedia.org/wiki/OSI_model
- derleth 14y agoIn terms of understanding the Internet, the OSI model is less useful than the Internet model outlined in RFC 1122 and RFC 1123, because the OSI model persists in making distinctions without a difference, like the separation of the Application and Presentation layers. (Frankly, most of the time the Link layer is entirely determined by the Physical layer, so that distinction is also of marginal use in the real world.) On a more historical note, the Internet protocol suite beat the OSI protocol suite. Practically nobody uses the OSI protocols anymore, so why bother trying to fit the Internet protocols into the OSI model? http://en.wikipedia.org/wiki/Internet_protocol_suite http://en.wikipedia.org/wiki/Internet_protocol_suite http://tools.ietf.org/html/rfc1122 http://tools.ietf.org/html/rfc1122 http://tools.ietf.org/html/rfc1123 http://tools.ietf.org/html/rfc1123
- brianpan 14y agoOSI is what I learned in school an age-and-a-half ago, that's why I included that link also. :)
- btilly 14y agoRather than considering them as a meaningful stack, I think it helps to know what each does. IP is a protocol for taking a chunk of data, slapping some addressing information on it, and then having it be sent, like an electronic letter, from one computer to another by whatever route the network thinks is best. More precisely every computer sends it to a computer it is directly connected to that it thinks is closer. Eventually, hopefully, it gets to the right place. If you just want to send chunks of data over IP and hope that they get there, you have UDP. TCP is a more advanced protocol where one computer contacts another, and then a stream of data starts to flow between them through a connection. Under the hood the stream is broken into chunks that are put in IP packets. And there are extra packets for things like, "Hello, trying to connect here" "I got these packets" "I'm done" and so on. Obviously TCP sits on top of IP. DNS is a protocol for turning a human readable name like news.ycombinator.com into an IP address like 174.132.225.106. Under the hood DNS uses both UDP and TCP. BGP is a protocol that is used between routers to advertise how to route packets. BGP uses TCP to work, so it is above TCP. But that routing information is used at the IP level, so bad routes can stop IP from working. Which is what happened here. Someone advertised that they were how to get to a lot of Google addresses, so routers began sending Google traffic there. When the packets arrived, they had no idea what to do with them and dropped them. The result is that the IP layer to Google stopped working for a lot of people.
- alok-g 14y agoNewbie question: If BGP uses TCP to work, TCP is above IP, and routers use BGP information to route IP packets, how may bootstrapping happen if needed?
- jauer 14y agoTypically no bootstrapping because IP (and thus TCP) work between hosts in the same subnet without routing. You would typically have a /30 or /31 subnet containing a pair of routers and have the routers communicate (BGP etc) using those addresses.