This paper presents a sum of squares (SOS) approach to the stability analysis of networked control systems (NCSs) incorporating bounded time-varying delays, bounded time-varying transmission intervals and a shared communication medium. A shared communication medium imposes that per transmission only one node, which consists of several actuators or sensors, can access the network and transmit its corresponding data. Which node obtains access is determined by a network protocol. We will provide mathematical models that describe these NCSs and transform them into suitable hybrid systems formulations. Based on these hybrid systems formulations we construct Lyapunov functions using SOS techniques that can be solved using LMI-based computations. This leads to several beneficial features: (i) we can deal with plants and controllers which are described by nonlinear (piecewise) polynomial differential equations, (ii) we can allow for non-zero lower bounds on the delays and transmission intervals in contrast with various existing approaches, (iii) we allow more flexibility in the Lyapunov functions thereby obtaining less conservative estimates of the maximal allowable transmission intervals (MATI) and maximal allowable delay (MAD), and finally (iv) it provides an automated method to address stability analysis problems in NCS. Several numerical examples illustrate the strengths of our approach.