Question: why origin is mandatory in bgp attribute?
Answer: The origin as-path attribute describes where a router received the route from. Origin information for each route MUST be transmitted in every BGP Update message as it is a well-known mandatory attribute. This means that ALL implementations of BGP must support it and pass it on when sending routing information.