A network flow approach to convolutional codes