The network segment between a router and a switch is considered as a collision domain? or a broadcast domain?
That depends on whether the connection between the router and the switch is half duplex or full duplex.
In a full duplex link each direction is it's own collision domain, which means there are two collision domains, but neither can experience any collisions as both a permanently clear to send (ignoring flow control). Also - cue discussion on whether a full duplex link has a collision domain at all....
With a half duplex link (not sure why you would want this) then the send and receive share the collision domain. In that case there is one.
If the link between the router and the switch is non-trunking (e.g. not 802.1Q) then there is likely a single broadcast domain. However, if you are running multiple VLANs, then there is a broadcast domain for each VLAN on the trunk.
It's both of them. It's a collision domain and it's also (a part of) broadcast domain.
Collision domain is defined as "where data packets can collide with one another when being sent". So if you connect switch and router directly, collision domain is only between this router and switch.
Broadcast domain is defined as "in which all nodes can reach each other by broadcast at the data link layer". So if you are using L2 switch, it will extend broadcast domain further.
Here is an example that should clear it up !
Router1 -- Switch -- Router2
Both the routers share one broadcast domain but have two separate collision domains. So,
Router1 and Switch : 1st collision domain
Router2 and Switch : 2nd collision domain
A broadcast domain generally means the area in which any broadcast packet would move till it hits a roadblock ( like another L3 device ).
A collision domain is simply building separate pipes for each connected device that would reduce the probability of packet collisions.
Each switch port is a separate collision domain. A switch is a bridge, and bridges separate collision domains, unlike hubs, where every hub port is in the same collision domain.
A VLAN is a broadcast domain. If the whole switch is, or multiple, connected switches are, a single VLAN, then you have a single broadcast domain. Routers break up broadcast domains, and to get from one VLAN to another, you must pass through a router.