Discipline in BDSM refers to the practice where the dominant sets rules for the submissive that he/she is expected to obey. When rules of expected behaviour are broken, oftentimes, punishment is used as a means of disciplining.
In BDSM, rules can be made so that a submissive ("sub") knows how he/she should behave (so that the dominant is not displeased), also rules can be for reminding the "subs" of their inferior status, or for training a novice "sub". When such rules are broken, often punishment is used as a means of disciplining. Punishment itself can be physical (ex. caning) or psychological (ex. public humiliation) or a combination of both (ex. through bondage).
The goal of discipline is to teach the "sub" that he/she has made a mistake, so that he/she learns self-restraint and becomes a better "sub" in future. So the punishment is generally related to the mistake done by "sub", also is generally proportionate to the amount and frequency of mistake. For example, a punishment for speaking out of turn for the first time may be a simple restraint (ex. being silenced using gag). The "sub" may also be given the option of choosing a punishment (ex. to be either caned on buttocks or slapped on face).
Punishments done on BDSM submissives, even very harsh ones, should not to be confused with sadomasochism. S&M is giving pain to "sub" for enjoyment by at least one out of dominant and "sub". Contrarily, punishments (for disciplining) are in response to violation of predetermined rules by "sub" or for otherwise displeasing the dominant. Punishment is like necessary evil in BDSM as without it "sub" may repeat mistakes in future and thus not improve as a "sub". Punishment is also not forced-abuse – in the former a "sub" must have granted his/her trainer prior authority to punish. Punishment should also not be confused with BDSM training which may involve giving pain just for increasing endurance limit of "sub".
Sometimes, disciplining may avoid punishment altogether and just a hard glance or loud voice from the dominant may work. Contrary to punishments, which is negative reinforcement, disciplining may also involve positive reinforcement. This includes rewarding the slave (ex. by praising) when he/she displays good behaviour. 
- Bound and Shagged: Discipline, Swarthmore College Daily, Oct 2012, retrieved 27 Aug 2017
- Encyclopedia of Social Deviance, page 75, SAGE Publications, 2017 ISBN 9781483364698
- Bill Henkin, Sybil Holiday: Consensual Sadomasochism: How to Talk About It and How to Do It Safely, Page 71. Daedalus Publishing Company, 1996, ISBN 978-1-881943-12-9.
- What is BDSM?, MensXP, October 2015, retrieved 27 August 2017