Segment Routing enables to steer packets through an ordered list of instructions, which can be topological or service-based. These instructions are called segments. We distinguish two types of topological segments: node segments and adjacency segments. The presence of a node segment forwards packets through a specific network node. Conversely, the presence of an adjacency segment forwards packets along a specific link. An additional type of segment, the service segment, which is local to a node, represents a service to apply to the packet. This type of segment is important in order to support Service Function Chaining. An important point to note is that between two segments, the packets are still forwarded along the shortest path towards the next segment. Many networks use Equal Cost Multipath (ECMP) to load-balance the traffic and Segment Routing is fully compatible with ECMP.
Consider the figure shown above for an illustration. Packets enter the network at router I and exit at router E. Consider that a packet enters the network and the ingress node pushes an SR header into the packet. We denote segments with the following notation: Ni segments are node segments corresponding to network node i, Sni segments are service segments, representing a service number n which is local to node i. Finally, Aij segments are adjacency segments representing the link between node i and node j. The header pushed by node I is composed of the following segments: ND, NB, S0B, NF, AFE. After having pushed the SR header, node I looks at the active segment, which is ND, a node segment to network node D. The packet is forwarded along the shortest path from I to D, which is I → A → D. Then, node D looks at the next segment, NB and again forwards it accordingly. Node B receives the packet and reads that the next segment, S0B, represents the service number 0 that it must apply. After having applied this service, node B looks at the next segment, which is a node segment to F. Node B thus forwards the packet to F. Finally, node F reads an adjacency segment from itself to node E and forwards the packet along this link and the packet exits the SR domain at node E.
The IPv6 flavor of Segment Routing is explained on this page.